-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Github Workflow to build and publish lucene snapshots. (#2906)
This change introduces a github workflow so that we can build and push snapshots of lucene. The RepositoriesSetupPlugin is also updated with a url from where these snapshots can be retrieved. Signed-off-by: Marc Handalian <handalm@amazon.com>
- Loading branch information
Showing
3 changed files
with
62 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# This workflow will check out, build, and publish snapshots of lucene. | ||
|
||
name: OpenSearch Lucene snapshots | ||
|
||
on: | ||
workflow_dispatch: | ||
# Inputs the workflow accepts. | ||
inputs: | ||
ref: | ||
description: | ||
required: false | ||
default: 'main' | ||
|
||
jobs: | ||
publish-snapshots: | ||
runs-on: ubuntu-latest | ||
# These permissions are needed to interact with GitHub's OIDC Token endpoint. | ||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '17' | ||
distribution: 'adopt' | ||
|
||
- name: Checkout Lucene | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: 'apache/lucene' | ||
path: lucene | ||
ref: ${{ github.event.inputs.ref }} | ||
|
||
- name: Set hash | ||
working-directory: ./lucene | ||
run: | | ||
echo "::set-output name=REVISION::$(git rev-parse --short HEAD)" | ||
id: version | ||
|
||
- name: Publish Lucene to local maven repo. | ||
working-directory: ./lucene | ||
run: ./gradlew publishJarsPublicationToMavenLocal -Pversion.suffix=snapshot-${{ steps.version.outputs.REVISION }} | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
role-to-assume: ${{ secrets.LUCENE_SNAPSHOTS_ROLE }} | ||
aws-region: us-west-2 | ||
|
||
- name: Copy files to S3 with the aws CLI. | ||
run: | | ||
aws s3 cp ~/.m2/repository/org/apache/lucene/ s3://${{ secrets.LUCENE_SNAPSHOTS_BUCKET }}/snapshots/lucene/org/apache/lucene/ --recursive --no-progress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters