Skip to content

Commit 4faf3e1

Browse files
Onboarding new maven snapshots publishing to s3 (opensearch-remote-metadata-sdk)
Signed-off-by: Peter Zhu <[email protected]>
1 parent ae88640 commit 4faf3e1

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

.github/workflows/publish-snapshots.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,14 @@ jobs:
3333
export-env: true
3434
env:
3535
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
36-
SONATYPE_USERNAME: op://opensearch-infra-secrets/maven-central-portal-credentials/username
37-
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
3844

3945
- name: publish snapshots to maven
4046
run: |

build.gradle

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ buildscript {
2929

3030
repositories {
3131
mavenLocal()
32-
maven { url = "https://central.sonatype.com/repository/maven-snapshots/" }
33-
maven { url = "https://aws.oss.sonatype.org/content/repositories/snapshots" }
32+
maven { url = "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
3433
mavenCentral()
3534
maven { url = "https://plugins.gradle.org/m2/" }
3635
}
@@ -53,8 +52,7 @@ allprojects {
5352

5453
repositories {
5554
mavenLocal()
56-
maven { url = "https://central.sonatype.com/repository/maven-snapshots/" }
57-
maven { url = "https://aws.oss.sonatype.org/content/repositories/snapshots" }
55+
maven { url = "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
5856
mavenCentral()
5957
maven { url = "https://plugins.gradle.org/m2/" }
6058
maven { url = "https://artifacts.opensearch.org/releases/" }
@@ -213,10 +211,11 @@ subprojects {
213211
}
214212
maven {
215213
name = "Snapshots"
216-
url = "https://central.sonatype.com/repository/maven-snapshots/"
217-
credentials {
218-
username = System.getenv("SONATYPE_USERNAME")
219-
password = System.getenv("SONATYPE_PASSWORD")
214+
url = System.getenv("MAVEN_SNAPSHOTS_S3_REPO")
215+
credentials(AwsCredentials) {
216+
accessKey = System.getenv("AWS_ACCESS_KEY_ID")
217+
secretKey = System.getenv("AWS_SECRET_ACCESS_KEY")
218+
sessionToken = System.getenv("AWS_SESSION_TOKEN")
220219
}
221220
}
222221
}

0 commit comments

Comments
 (0)