From b5ad2dabcb87969266781c9c33e46ad56de1f2d2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 2 Sep 2025 15:55:50 +0000 Subject: [PATCH 1/2] [Backport 2.19] Update the maven snapshot publish endpoint and credential (#1433) (#1481) * Update the maven snapshot publish endpoint and credential (#1433) Signed-off-by: Zelin Hao (cherry picked from commit 61f36616d3cd2aa59f7d043df1d32baa0d749bc6) * Change bwc version to 2.18 Signed-off-by: Craig Perkins --------- Signed-off-by: Zelin Hao Signed-off-by: Craig Perkins Co-authored-by: Zelin Hao (cherry picked from commit 6655cc585f81723bfae194bde1b10e04a8d6bdad) Signed-off-by: github-actions[bot] --- .github/workflows/maven-publish.yml | 21 +++++++++++---------- build.gradle | 6 ++++-- spi/build.gradle | 3 ++- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 5e947b345..1e794946d 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -20,17 +20,18 @@ jobs: - uses: actions/setup-java@v3 with: distribution: temurin # Temurin is a distribution of adoptium - java-version: 11 - - uses: actions/checkout@v3 - - uses: aws-actions/configure-aws-credentials@v1 + java-version: 21 + - uses: actions/checkout@v4 + - name: Load secret + uses: 1password/load-secrets-action@v2 with: - role-to-assume: ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }} - aws-region: us-east-1 + # Export loaded secrets as environment variables + export-env: true + env: + OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} + SONATYPE_USERNAME: op://opensearch-infra-secrets/maven-central-portal-credentials/username + SONATYPE_PASSWORD: op://opensearch-infra-secrets/maven-central-portal-credentials/password - 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 - ./gradlew publishShadowPublicationToSnapshotsRepository \ No newline at end of file + ./gradlew publishShadowPublicationToSnapshotsRepository diff --git a/build.gradle b/build.gradle index ea3700262..cbd8dc25e 100644 --- a/build.gradle +++ b/build.gradle @@ -72,6 +72,7 @@ buildscript { mavenLocal() mavenCentral() maven { url "https://plugins.gradle.org/m2/" } + maven { url "https://central.sonatype.com/repository/maven-snapshots/" } maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" } } @@ -234,6 +235,7 @@ dependencies { repositories { mavenLocal() + maven { url "https://central.sonatype.com/repository/maven-snapshots/" } maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" } } @@ -262,7 +264,7 @@ publishing { repositories { maven { name = "Snapshots" - url = "https://aws.oss.sonatype.org/content/repositories/snapshots" + url = "https://central.sonatype.com/repository/maven-snapshots/" credentials { username "$System.env.SONATYPE_USERNAME" password "$System.env.SONATYPE_PASSWORD" @@ -635,7 +637,7 @@ task integTestRemote(type: RestIntegTestTask) { // === Set up BWC tests === -String bwcMinVersion = "2.9.0.0" +String bwcMinVersion = "2.18.0.0" String bwcBundleVersion = "1.3.2.0" Boolean bwcBundleTest = (project.findProperty('customDistributionDownloadType') != null && project.properties['customDistributionDownloadType'] == "bundle"); diff --git a/spi/build.gradle b/spi/build.gradle index 0a247b359..8d32213fe 100644 --- a/spi/build.gradle +++ b/spi/build.gradle @@ -50,6 +50,7 @@ repositories { mavenLocal() mavenCentral() maven { url "https://plugins.gradle.org/m2/" } + maven { url "https://central.sonatype.com/repository/maven-snapshots/" } maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" } } @@ -118,7 +119,7 @@ publishing { } maven { name = "Snapshots" - url = "https://aws.oss.sonatype.org/content/repositories/snapshots" + url = "https://central.sonatype.com/repository/maven-snapshots/" credentials { username "$System.env.SONATYPE_USERNAME" password "$System.env.SONATYPE_PASSWORD" From 4439bed43aa01538687bc7eb989de924fc1958db Mon Sep 17 00:00:00 2001 From: Craig Perkins Date: Tue, 2 Sep 2025 11:58:06 -0400 Subject: [PATCH 2/2] Update build.gradle Signed-off-by: Craig Perkins --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index cbd8dc25e..a142e4821 100644 --- a/build.gradle +++ b/build.gradle @@ -637,7 +637,7 @@ task integTestRemote(type: RestIntegTestTask) { // === Set up BWC tests === -String bwcMinVersion = "2.18.0.0" +String bwcMinVersion = "2.9.0.0" String bwcBundleVersion = "1.3.2.0" Boolean bwcBundleTest = (project.findProperty('customDistributionDownloadType') != null && project.properties['customDistributionDownloadType'] == "bundle");