forked from martin-gaievski/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (49 loc) · 1.71 KB
/
lucene-snapshots.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# 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: Initialize gradle settings
working-directory: ./lucene
run: ./gradlew localSettings
- 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