From 79574aecf778bb08dc8205fdf911c56111da64d0 Mon Sep 17 00:00:00 2001 From: Daniel Widdis Date: Thu, 2 Jan 2025 08:44:23 -0800 Subject: [PATCH 1/2] Publish snapshots to Central Repository Signed-off-by: Daniel Widdis --- .github/workflows/publish-snapshots.yml | 38 +++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/publish-snapshots.yml diff --git a/.github/workflows/publish-snapshots.yml b/.github/workflows/publish-snapshots.yml new file mode 100644 index 0000000..5d699ba --- /dev/null +++ b/.github/workflows/publish-snapshots.yml @@ -0,0 +1,38 @@ +name: Publish snapshots to maven + +on: + workflow_dispatch: + push: + branches: + - 'main' + - '1.*' + - '2.*' + +jobs: + build-and-publish-snapshots: + strategy: + fail-fast: false + if: github.repository == 'opensearch-project/opensearch-remote-metadata-sdk' + runs-on: ubuntu-latest + + permissions: + id-token: write + contents: write + + steps: + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 21 + - uses: actions/checkout@v4 + - uses: aws-actions/configure-aws-credentials@v4.0.2 + with: + role-to-assume: ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }} + aws-region: us-east-1 + - name: 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" + ./gradlew publishPluginZipPublicationToSnapshotsRepository From d60d1eab62dd672314119380ebf1aeb6b5e37f84 Mon Sep 17 00:00:00 2001 From: Daniel Widdis Date: Thu, 2 Jan 2025 10:05:40 -0800 Subject: [PATCH 2/2] Remove 1.x, use correct publish command for repo Signed-off-by: Daniel Widdis --- .github/workflows/publish-snapshots.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-snapshots.yml b/.github/workflows/publish-snapshots.yml index 5d699ba..356a866 100644 --- a/.github/workflows/publish-snapshots.yml +++ b/.github/workflows/publish-snapshots.yml @@ -1,11 +1,10 @@ -name: Publish snapshots to maven +name: Publish snapshots to Maven on: workflow_dispatch: push: branches: - 'main' - - '1.*' - '2.*' jobs: @@ -35,4 +34,4 @@ jobs: 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" - ./gradlew publishPluginZipPublicationToSnapshotsRepository + ./gradlew publishMavenJavaPublicationToSnapshotsRepository