update backport version to 2.2.0 (#51) #30
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
name: Publish snapshots to maven | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-publish-snapshots: | |
strategy: | |
fail-fast: false | |
if: github.repository == 'opensearch-project/opensearch-spark' | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 11 | |
- name: Publish to Local Maven | |
run: | | |
sbt standaloneCosmetic/publishM2 | |
sbt sparkSqlApplicationCosmetic/publishM2 | |
- uses: actions/checkout@v3 | |
with: | |
repository: 'opensearch-project/opensearch-build-libraries' | |
path: 'build' | |
- name: Configure AWS credentials | |
uses: aws-actions/[email protected] | |
with: | |
role-to-assume: ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }} | |
aws-region: us-east-1 | |
- name: generate sha and md5 | |
run: | | |
for i in `find ${HOME}/.m2/repository/org/opensearch/ -name "*.pom" -type f`; do sha512sum "$i" | awk '{print $1}' >> "$i.sha512"; done | |
for i in `find ${HOME}/.m2/repository/org/opensearch/ -name "*.jar" -type f`; do sha512sum "$i" | awk '{print $1}' >> "$i.sha512"; done | |
for i in `find ${HOME}/.m2/repository/org/opensearch/ -name "*.pom" -type f`; do sha256sum "$i" | awk '{print $1}' >> "$i.sha256"; done | |
for i in `find ${HOME}/.m2/repository/org/opensearch/ -name "*.jar" -type f`; do sha256sum "$i" | awk '{print $1}' >> "$i.sha256"; done | |
- name: Get credentials and publish snapshots to maven | |
run: | | |
export SONATYPE_USERNAME=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-username --query SecretString --output text) | |
export SONATYPE_PASSWORD=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-password --query SecretString --output text) | |
echo "::add-mask::$SONATYPE_USERNAME" | |
echo "::add-mask::$SONATYPE_PASSWORD" | |
export SNAPSHOT_REPO_URL="https://aws.oss.sonatype.org/content/repositories/snapshots/" | |
cd build/resources/publish/ | |
cp -a $HOME/.m2/repository/* ./ | |
./publish-snapshot.sh ./ |