Skip to content

Commit 504c535

Browse files
authored
Update the maven snapshot publish endpoint and credential (opensearch-project#3929)
1 parent d47ba65 commit 504c535

File tree

7 files changed

+17
-11
lines changed

7 files changed

+17
-11
lines changed

.github/workflows/maven-publish.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,17 @@ jobs:
2525
distribution: temurin # Temurin is a distribution of adoptium
2626
java-version: 21
2727
- uses: actions/checkout@v3
28-
- uses: aws-actions/[email protected]
28+
29+
- name: Load secret
30+
uses: 1password/load-secrets-action@v2
2931
with:
30-
role-to-assume: ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }}
31-
aws-region: us-east-1
32+
# Export loaded secrets as environment variables
33+
export-env: true
34+
env:
35+
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
38+
3239
- name: publish snapshots to maven
3340
run: |
34-
export SONATYPE_USERNAME=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-username --query SecretString --output text)
35-
export SONATYPE_PASSWORD=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-password --query SecretString --output text)
36-
echo "::add-mask::$SONATYPE_USERNAME"
37-
echo "::add-mask::$SONATYPE_PASSWORD"
3841
./gradlew publishPluginZipPublicationToSnapshotsRepository publishShadowPublicationToSnapshotsRepository

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
maven {url 'https://oss.sonatype.org/content/repositories/snapshots/'}

build.gradle

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

3232
repositories {
3333
mavenLocal()
34+
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
3435
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
3536
mavenCentral()
3637
maven { url "https://plugins.gradle.org/m2/" }

client/build.gradle

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

common/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ publishing {
117117
}
118118
maven {
119119
name = "Snapshots" // optional target repository name
120-
url = "https://aws.oss.sonatype.org/content/repositories/snapshots"
120+
url = "https://central.sonatype.com/repository/maven-snapshots/"
121121
credentials {
122122
username "$System.env.SONATYPE_USERNAME"
123123
password "$System.env.SONATYPE_PASSWORD"

plugin/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ publishing {
128128
mavenCentral()
129129
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/lucene/" }
130130
name = "Snapshots"
131-
url = "https://aws.oss.sonatype.org/content/repositories/snapshots"
131+
url = "https://central.sonatype.com/repository/maven-snapshots/"
132132
credentials {
133133
username "$System.env.SONATYPE_USERNAME"
134134
password "$System.env.SONATYPE_PASSWORD"

spi/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ apply plugin: 'opensearch.java'
1818
repositories {
1919
mavenLocal()
2020
mavenCentral()
21+
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
2122
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
2223
}
2324

@@ -96,7 +97,7 @@ publishing {
9697
}
9798
maven {
9899
name = "Snapshots" // optional target repository name
99-
url = "https://aws.oss.sonatype.org/content/repositories/snapshots"
100+
url = "https://central.sonatype.com/repository/maven-snapshots/"
100101
credentials {
101102
username "$System.env.SONATYPE_USERNAME"
102103
password "$System.env.SONATYPE_PASSWORD"

0 commit comments

Comments
 (0)