diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index c6bb78c863..cff7e136fc 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -22,14 +22,15 @@ jobs: distribution: temurin # Temurin is a distribution of adoptium java-version: 21 - uses: actions/checkout@v4 - - uses: aws-actions/configure-aws-credentials@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 --no-daemon publishPluginZipPublicationToSnapshotsRepository publishShadowPublicationToSnapshotsRepository diff --git a/build.gradle b/build.gradle index 272df4b09d..475da7f7a2 100644 --- a/build.gradle +++ b/build.gradle @@ -48,6 +48,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" } maven { url "https://artifacts.opensearch.org/snapshots/lucene/" } maven { url "https://build.shibboleth.net/nexus/content/groups/public" } @@ -423,7 +424,7 @@ publishing { repositories { maven { name = "Snapshots" // optional target repository name - 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" @@ -504,6 +505,7 @@ allprojects { 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" } maven { url "https://artifacts.opensearch.org/snapshots/lucene/" } maven { url "https://build.shibboleth.net/nexus/content/repositories/releases" } diff --git a/bwc-test/build.gradle b/bwc-test/build.gradle index d5f4db951e..6bdd8e7376 100644 --- a/bwc-test/build.gradle +++ b/bwc-test/build.gradle @@ -51,6 +51,7 @@ buildscript { } repositories { mavenLocal() + maven { url "https://central.sonatype.com/repository/maven-snapshots/" } maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" } mavenCentral() maven { url "https://plugins.gradle.org/m2/" } @@ -63,6 +64,7 @@ buildscript { repositories { mavenLocal() + maven { url "https://central.sonatype.com/repository/maven-snapshots/" } maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" } mavenCentral() maven { url "https://plugins.gradle.org/m2/" } diff --git a/sample-resource-plugin/build.gradle b/sample-resource-plugin/build.gradle index a881b78100..19fed064dd 100644 --- a/sample-resource-plugin/build.gradle +++ b/sample-resource-plugin/build.gradle @@ -55,6 +55,7 @@ ext { repositories { mavenLocal() mavenCentral() + maven { url "https://central.sonatype.com/repository/maven-snapshots/" } maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" } } diff --git a/spi/build.gradle b/spi/build.gradle index f75814f78a..d8bb880d5f 100644 --- a/spi/build.gradle +++ b/spi/build.gradle @@ -16,6 +16,7 @@ ext { repositories { mavenLocal() mavenCentral() + maven { url "https://central.sonatype.com/repository/maven-snapshots/" } maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" } } @@ -80,7 +81,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"