File tree Expand file tree Collapse file tree 2 files changed +19
-15
lines changed
Expand file tree Collapse file tree 2 files changed +19
-15
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,10 @@ name: Publish snapshots to maven
33on :
44 workflow_dispatch :
55 push :
6- branches : [
7- main
8- 1.*
9- 2.*
10- ]
6+ branches :
7+ - ' main'
8+ - ' [0-9]+.[0-9]+'
9+ - ' [0-9]+.x'
1110
1211jobs :
1312 build-and-publish-snapshots :
3433 export-env : true
3534 env :
3635 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
36+ MAVEN_SNAPSHOTS_S3_REPO : op://opensearch-infra-secrets/maven-snapshots-s3/repo
37+ MAVEN_SNAPSHOTS_S3_ROLE : op://opensearch-infra-secrets/maven-snapshots-s3/role
38+
39+ - name : Configure AWS credentials
40+ uses : aws-actions/configure-aws-credentials@v5
41+ with :
42+ role-to-assume : ${{ env.MAVEN_SNAPSHOTS_S3_ROLE }}
43+ aws-region : us-east-1
3944
4045 - name : publish snapshots to maven
4146 run : |
Original file line number Diff line number Diff line change @@ -50,8 +50,7 @@ buildscript {
5050 repositories {
5151 mavenLocal()
5252 mavenCentral()
53- maven { url " https://central.sonatype.com/repository/maven-snapshots/" }
54- maven { url " https://aws.oss.sonatype.org/content/repositories/snapshots" }
53+ maven { url " https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
5554 }
5655
5756 dependencies {
@@ -169,10 +168,11 @@ publishing {
169168 repositories {
170169 maven {
171170 name = " Snapshots"
172- url = " https://central.sonatype.com/repository/maven-snapshots/"
173- credentials {
174- username " $System . env . SONATYPE_USERNAME "
175- password " $System . env . SONATYPE_PASSWORD "
171+ url = System . getenv(" MAVEN_SNAPSHOTS_S3_REPO" )
172+ credentials(AwsCredentials ) {
173+ accessKey = System . getenv(" AWS_ACCESS_KEY_ID" )
174+ secretKey = System . getenv(" AWS_SECRET_ACCESS_KEY" )
175+ sessionToken = System . getenv(" AWS_SESSION_TOKEN" )
176176 }
177177 }
178178 }
@@ -181,8 +181,7 @@ publishing {
181181repositories {
182182 mavenLocal()
183183 mavenCentral()
184- maven { url " https://central.sonatype.com/repository/maven-snapshots/" }
185- maven { url " https://aws.oss.sonatype.org/content/repositories/snapshots" }
184+ maven { url " https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
186185}
187186
188187sourceSets. main. java. srcDirs = [' src/main/generated' ,' src/main/java' ]
You can’t perform that action at this time.
0 commit comments