diff --git a/.github/workflows/publish-snapshots.yml b/.github/workflows/publish-snapshots.yml index beaee9a413..59a593d192 100644 --- a/.github/workflows/publish-snapshots.yml +++ b/.github/workflows/publish-snapshots.yml @@ -27,8 +27,13 @@ jobs: 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 + MAVEN_SNAPSHOTS_S3_REPO: op://opensearch-infra-secrets/maven-snapshots-s3/repo + MAVEN_SNAPSHOTS_S3_ROLE: op://opensearch-infra-secrets/maven-snapshots-s3/role + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v5 + with: + role-to-assume: ${{ env.MAVEN_SNAPSHOTS_S3_ROLE }} + aws-region: us-east-1 - name: publish snapshots to maven run: | - ./gradlew --no-daemon publishPublishMavenPublicationToSnapshotsRepository \ No newline at end of file + ./gradlew --no-daemon publishPublishMavenPublicationToSnapshotsRepository diff --git a/README.md b/README.md index 10bc0bdb5a..0e5fd76583 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ This project has adopted the [Amazon Open Source Code of Conduct](CODE_OF_CONDUC See [User Guide](USER_GUIDE.md). ## Snapshot Builds -The [snapshots builds](https://central.sonatype.com/repository/maven-snapshots/org/opensearch/client/opensearch-java/maven-metadata.xml) are published to sonatype using [publish-snapshots.yml](./.github/workflows/publish-snapshots.yml) workflow. Each `push` event to the main branch triggers this workflow. +The [snapshots builds](https://ci.opensearch.org/ci/dbc/snapshots/maven/org/opensearch/client/opensearch-java/maven-metadata.xml) are published to sonatype using [publish-snapshots.yml](./.github/workflows/publish-snapshots.yml) workflow. Each `push` event to the main branch triggers this workflow. ## Compatibility with OpenSearch diff --git a/build.gradle.kts b/build.gradle.kts index 8e97a12df3..50b084bcf8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -38,8 +38,7 @@ allprojects { repositories { mavenLocal() - maven(url = "https://central.sonatype.com/repository/maven-snapshots/") - maven(url = "https://aws.oss.sonatype.org/content/repositories/snapshots") + maven(url = "https://ci.opensearch.org/ci/dbc/snapshots/maven/") mavenCentral() gradlePluginPortal() } diff --git a/java-client/build.gradle.kts b/java-client/build.gradle.kts index 56e6d35b53..26c5d7512f 100644 --- a/java-client/build.gradle.kts +++ b/java-client/build.gradle.kts @@ -38,8 +38,7 @@ import java.io.FileWriter buildscript { repositories { mavenLocal() - maven(url = "https://central.sonatype.com/repository/maven-snapshots/") - maven(url = "https://aws.oss.sonatype.org/content/repositories/snapshots") + maven(url = "https://ci.opensearch.org/ci/dbc/snapshots/maven/") mavenCentral() gradlePluginPortal() } @@ -177,7 +176,7 @@ val integrationTest = task("integrationTest") { System.getProperty("tests.awsSdk2support.domainRegion", "us-east-1")) } -val opensearchVersion = "3.0.0-beta1-SNAPSHOT" +val opensearchVersion = "3.0.0-SNAPSHOT" dependencies { val jacksonVersion = "2.18.3" @@ -318,11 +317,12 @@ tasks.withType { publishing { repositories{ if (version.toString().endsWith("SNAPSHOT")) { - maven("https://central.sonatype.com/repository/maven-snapshots/") { + maven(providers.environmentVariable("MAVEN_SNAPSHOTS_S3_REPO")) { name = "Snapshots" - credentials { - username = System.getenv("SONATYPE_USERNAME") - password = System.getenv("SONATYPE_PASSWORD") + credentials(AwsCredentials::class) { + accessKey = System.getenv("AWS_ACCESS_KEY_ID") + secretKey = System.getenv("AWS_SECRET_ACCESS_KEY") + sessionToken = System.getenv("AWS_SESSION_TOKEN") } } } @@ -405,4 +405,4 @@ if (runtimeJavaVersion >= JavaVersion.VERSION_21) { testImplementation("org.bouncycastle", "bcprov-lts8on", "2.73.6") testImplementation("org.bouncycastle", "bcpkix-lts8on", "2.73.6") } -} +} \ No newline at end of file diff --git a/java-codegen/build.gradle.kts b/java-codegen/build.gradle.kts index 4711f32e85..576b81b323 100644 --- a/java-codegen/build.gradle.kts +++ b/java-codegen/build.gradle.kts @@ -19,8 +19,7 @@ import java.io.FileWriter buildscript { repositories { mavenLocal() - maven(url = "https://central.sonatype.com/repository/maven-snapshots/") - maven(url = "https://aws.oss.sonatype.org/content/repositories/snapshots") + maven(url = "https://ci.opensearch.org/ci/dbc/snapshots/maven/") mavenCentral() gradlePluginPortal() } @@ -266,4 +265,4 @@ tasks.withType { spotlessConventions { eclipseFormatterConfigFile = rootProject.file("buildSrc/formatterConfig-generated.xml") -} \ No newline at end of file +}