File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed
Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -26,14 +26,17 @@ jobs:
2626 distribution : temurin # Temurin is a distribution of adoptium
2727 java-version : ${{ matrix.java }}
2828 - uses : actions/checkout@v4
29- - uses : aws-actions/configure-aws-credentials@v1
29+
30+ - name : Load secret
31+ uses : 1password/load-secrets-action@v2
3032 with :
31- role-to-assume : ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }}
32- aws-region : us-east-1
33+ # Export loaded secrets as environment variables
34+ export-env : true
35+ env :
36+ OP_SERVICE_ACCOUNT_TOKEN : ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
37+ SONATYPE_USERNAME : op://opensearch-infra-secrets/maven-central-portal-credentials/username
38+ SONATYPE_PASSWORD : op://opensearch-infra-secrets/maven-central-portal-credentials/password
39+
3340 - name : publish snapshots to maven
3441 run : |
35- export SONATYPE_USERNAME=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-username --query SecretString --output text)
36- export SONATYPE_PASSWORD=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-password --query SecretString --output text)
37- echo "::add-mask::$SONATYPE_USERNAME"
38- echo "::add-mask::$SONATYPE_PASSWORD"
3942 ./gradlew publishPluginZipPublicationToSnapshotsRepository
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ buildscript {
2929 mavenLocal()
3030 mavenCentral()
3131 maven { url " https://plugins.gradle.org/m2/" }
32+ maven { url " https://central.sonatype.com/repository/maven-snapshots/" }
3233 maven { url " https://aws.oss.sonatype.org/content/repositories/snapshots" }
3334 }
3435
@@ -51,6 +52,7 @@ repositories {
5152 mavenLocal()
5253 mavenCentral()
5354 maven { url " https://plugins.gradle.org/m2/" }
55+ maven { url " https://central.sonatype.com/repository/maven-snapshots/" }
5456 maven { url " https://aws.oss.sonatype.org/content/repositories/snapshots" }
5557}
5658apply plugin : ' java'
@@ -105,7 +107,7 @@ publishing {
105107 repositories {
106108 maven {
107109 name = " Snapshots"
108- url = " https://aws.oss. sonatype.org/content/repositories/ snapshots"
110+ url = " https://central. sonatype.com/repository/maven- snapshots/ "
109111 credentials {
110112 username " $System . env . SONATYPE_USERNAME "
111113 password " $System . env . SONATYPE_PASSWORD "
You can’t perform that action at this time.
0 commit comments