OpenSearch snapshots #4
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 workflow will check out, build, and publish snapshots of OpenSearch Core. | |
name: OpenSearch snapshots | |
on: | |
workflow_dispatch: | |
# Inputs the workflow accepts. | |
inputs: | |
ref: | |
description: | |
required: false | |
default: 'main' | |
jobs: | |
publish-snapshots: | |
if: github.repository == 'lucenia/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@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Checkout build repo | |
uses: actions/checkout@v4 | |
with: | |
repository: lucenia/build | |
ref: main | |
path: lucenia-build | |
- name: Copy settings.xml | |
run: | | |
cp lucenia-build/maven/settings.xml ~/.m2/ | |
- name: Checkout OpenSearch Core | |
uses: actions/checkout@v4 | |
with: | |
repository: 'opensearch-project/opensearch' | |
path: opensearch | |
ref: ${{ github.event.inputs.ref }} | |
- name: Publish OpenSearch to local maven repo. | |
working-directory: ./opensearch | |
run: ./gradlew publishToMavenLocal | |
- name: Publish OpenSearch to github packages | |
env: | |
USERNAME: ${{ secrets.SNAPSHOTS_USER }} | |
ACCESS_TOKEN: ${{ secrets.SNAPSHOTS_TOKEN }} | |
run: | | |
bash lucenia-build/scripts/gradle/publish-to-github-packages.sh ~/.m2/repository/ lucenia snapshots github |