File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,14 +21,17 @@ jobs:
2121 distribution : temurin # Temurin is a distribution of adoptium
2222 java-version : 11
2323 - uses : actions/checkout@v3
24- - uses : aws-actions/configure-aws-credentials@v1
24+
25+ - name : Load secret
26+ uses : 1password/load-secrets-action@v2
2527 with :
26- role-to-assume : ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }}
27- aws-region : us-east-1
28+ # Export loaded secrets as environment variables
29+ export-env : true
30+ env :
31+ OP_SERVICE_ACCOUNT_TOKEN : ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
32+ SONATYPE_USERNAME : op://opensearch-infra-secrets/maven-central-portal-credentials/username
33+ SONATYPE_PASSWORD : op://opensearch-infra-secrets/maven-central-portal-credentials/password
34+
2835 - name : publish snapshots to maven
2936 run : |
30- export SONATYPE_USERNAME=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-username --query SecretString --output text)
31- export SONATYPE_PASSWORD=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-password --query SecretString --output text)
32- echo "::add-mask::$SONATYPE_USERNAME"
33- echo "::add-mask::$SONATYPE_PASSWORD"
3437 ./gradlew publishPluginZipPublicationToSnapshotsRepository
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ buildscript {
3434 // Used to resolve build file dependencies
3535 repositories {
3636 mavenLocal()
37+ maven { url " https://central.sonatype.com/repository/maven-snapshots/" }
3738 maven { url " https://aws.oss.sonatype.org/content/repositories/snapshots" }
3839 mavenCentral()
3940 maven { url " https://plugins.gradle.org/m2/" }
@@ -165,7 +166,7 @@ publishing {
165166 repositories {
166167 maven {
167168 name = " Snapshots"
168- url = " https://aws.oss. sonatype.org/content/repositories/ snapshots"
169+ url = " https://central. sonatype.com/repository/maven- snapshots/ "
169170 credentials {
170171 username " $System . env . SONATYPE_USERNAME "
171172 password " $System . env . SONATYPE_PASSWORD "
@@ -197,6 +198,7 @@ publishing {
197198
198199repositories {
199200 mavenLocal()
201+ maven { url " https://central.sonatype.com/repository/maven-snapshots/" }
200202 maven { url " https://aws.oss.sonatype.org/content/repositories/snapshots" }
201203 mavenCentral()
202204 maven { url " https://plugins.gradle.org/m2/" }
You can’t perform that action at this time.
0 commit comments