Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@ jobs:
distribution: temurin # Temurin is a distribution of adoptium
java-version: 17
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v1

- name: Load secret
uses: 1password/load-secrets-action@v2
with:
role-to-assume: ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }}
aws-region: us-east-1
# Export loaded secrets as environment variables
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
SONATYPE_USERNAME: op://opensearch-infra-secrets/maven-central-portal-credentials/username
SONATYPE_PASSWORD: op://opensearch-infra-secrets/maven-central-portal-credentials/password

- name: publish snapshots to maven
run: |
export SONATYPE_USERNAME=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-username --query SecretString --output text)
export SONATYPE_PASSWORD=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-password --query SecretString --output text)
echo "::add-mask::$SONATYPE_USERNAME"
echo "::add-mask::$SONATYPE_PASSWORD"
./gradlew publishPluginZipPublicationToSnapshotsRepository
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
}

Expand Down Expand Up @@ -167,7 +168,7 @@ publishing {
repositories {
maven {
name = "Snapshots"
url = "https://aws.oss.sonatype.org/content/repositories/snapshots"
url = "https://central.sonatype.com/repository/maven-snapshots/"
credentials {
username "$System.env.SONATYPE_USERNAME"
password "$System.env.SONATYPE_PASSWORD"
Expand All @@ -179,6 +180,7 @@ publishing {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
}

Expand Down
Loading