Skip to content

Commit 34ac901

Browse files
authored
Update the maven snapshot publish endpoint and credential (#1869)
Signed-off-by: Zelin Hao <[email protected]>
1 parent a965dad commit 34ac901

File tree

6 files changed

+13
-9
lines changed

6 files changed

+13
-9
lines changed

.github/workflows/maven-publish.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,16 @@ jobs:
2828
distribution: temurin # Temurin is a distribution of adoptium
2929
java-version: ${{ matrix.jdk }}
3030
- uses: actions/checkout@v4
31-
- uses: aws-actions/configure-aws-credentials@v1
31+
- name: Load secret
32+
uses: 1password/load-secrets-action@v2
3233
with:
33-
role-to-assume: ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }}
34-
aws-region: us-east-1
34+
# Export loaded secrets as environment variables
35+
export-env: true
36+
env:
37+
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
3540
- name: publish snapshots to maven
3641
run: |
37-
export SONATYPE_USERNAME=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-username --query SecretString --output text)
38-
export SONATYPE_PASSWORD=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-password --query SecretString --output text)
39-
echo "::add-mask::$SONATYPE_USERNAME"
40-
echo "::add-mask::$SONATYPE_PASSWORD"
4142
./gradlew publishShadowPublicationToSnapshotsRepository
4243
./gradlew publishPluginZipPublicationToSnapshotsRepository

alerting/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ publishing {
8383
repositories {
8484
maven {
8585
name = "Snapshots"
86-
url = "https://aws.oss.sonatype.org/content/repositories/snapshots"
86+
url = "https://central.sonatype.com/repository/maven-snapshots/"
8787
credentials {
8888
username "$System.env.SONATYPE_USERNAME"
8989
password "$System.env.SONATYPE_PASSWORD"

build-tools/repositories.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
repositories {
77
mavenLocal()
8+
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
89
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
910
mavenCentral()
1011
}

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ buildscript {
2828

2929
repositories {
3030
mavenLocal()
31+
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
3132
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
3233
mavenCentral()
3334
maven { url "https://plugins.gradle.org/m2/" }

sample-remote-monitor-plugin/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ ext {
3030
repositories {
3131
mavenLocal()
3232
mavenCentral()
33+
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
3334
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
3435
}
3536

spi/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ publishing {
4444
}
4545
maven {
4646
name = "Snapshots"
47-
url = "https://aws.oss.sonatype.org/content/repositories/snapshots"
47+
url = "https://central.sonatype.com/repository/maven-snapshots/"
4848
credentials {
4949
username "$System.env.SONATYPE_USERNAME"
5050
password "$System.env.SONATYPE_PASSWORD"

0 commit comments

Comments
 (0)