Skip to content

Commit 918b033

Browse files
Onboarding new maven snapshots publishing to s3 (async) (#782)
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
1 parent 549b029 commit 918b033

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

.github/workflows/maven-publish.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,14 @@ jobs:
3535
export-env: true
3636
env:
3737
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
38-
SONATYPE_USERNAME: op://opensearch-infra-secrets/maven-central-portal-credentials/username
39-
SONATYPE_PASSWORD: op://opensearch-infra-secrets/maven-central-portal-credentials/password
38+
MAVEN_SNAPSHOTS_S3_REPO: op://opensearch-infra-secrets/maven-snapshots-s3/repo
39+
MAVEN_SNAPSHOTS_S3_ROLE: op://opensearch-infra-secrets/maven-snapshots-s3/role
40+
41+
- name: Configure AWS credentials
42+
uses: aws-actions/configure-aws-credentials@v5
43+
with:
44+
role-to-assume: ${{ env.MAVEN_SNAPSHOTS_S3_ROLE }}
45+
aws-region: us-east-1
4046

4147
- name: publish snapshots to maven
4248
run: |

build.gradle

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ buildscript {
2828
mavenLocal()
2929
mavenCentral()
3030
maven { url "https://plugins.gradle.org/m2/" }
31-
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
32-
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
31+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
3332
}
3433

3534
dependencies {
@@ -52,8 +51,7 @@ repositories {
5251
mavenLocal()
5352
mavenCentral()
5453
maven { url "https://plugins.gradle.org/m2/" }
55-
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
56-
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
54+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
5755
}
5856
apply plugin: 'java'
5957
apply plugin: 'jacoco'
@@ -108,10 +106,11 @@ publishing {
108106
repositories {
109107
maven {
110108
name = "Snapshots"
111-
url = "https://central.sonatype.com/repository/maven-snapshots/"
112-
credentials {
113-
username System.getenv("SONATYPE_USERNAME")
114-
password System.getenv("SONATYPE_PASSWORD")
109+
url = System.getenv("MAVEN_SNAPSHOTS_S3_REPO")
110+
credentials(AwsCredentials) {
111+
accessKey = System.getenv("AWS_ACCESS_KEY_ID")
112+
secretKey = System.getenv("AWS_SECRET_ACCESS_KEY")
113+
sessionToken = System.getenv("AWS_SESSION_TOKEN")
115114
}
116115
}
117116
}

0 commit comments

Comments
 (0)