OpenSearch/.github/workflows/lucene-snapshots.yml

56 lines
1.6 KiB
YAML
Raw Normal View History

# 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