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
69 changes: 35 additions & 34 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
name: Publish snapshots to maven

on:
workflow_dispatch:
push:
branches: [
main
1.*
2.*
]

jobs:
build-and-publish-snapshots:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/setup-java@v3
with:
distribution: temurin # Temurin is a distribution of adoptium
java-version: 17
- uses: actions/checkout@v3
- uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }}
aws-region: us-east-1
- 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
name: Publish snapshots to maven

on:
workflow_dispatch:
push:
branches:
- main
- '[0-9]+.[0-9]+'
- '[0-9]+.x'
jobs:
build-and-publish-snapshots:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/setup-java@v4
with:
distribution: temurin # Temurin is a distribution of adoptium
java-version: 21
- uses: actions/checkout@v4

- name: Load secret
uses: 1password/load-secrets-action@v2
with:
# 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: |
./gradlew publishPluginZipPublicationToSnapshotsRepository
4 changes: 2 additions & 2 deletions .github/workflows/security-knn-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
opensearch_version=$(grep "System.getProperty(\"opensearch.version\", \"" build.gradle | grep '\([0-9]\|[.]\)\{5\}' -o)
opensearch_version=$opensearch_version".0-SNAPSHOT"
# we publish build artifacts to the below url
sec_plugin_url="https://aws.oss.sonatype.org/content/repositories/snapshots/org/opensearch/plugin/opensearch-security/"$opensearch_version"/"
sec_plugin_url="https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/org/opensearch/plugin/opensearch-security/"$opensearch_version"/"
sec_st=$(curl -s -o /dev/null -w "%{http_code}" $sec_plugin_url)
if [ "$sec_st" = "200" ]; then
echo "isSecurityPluginAvailable=True" >> $GITHUB_OUTPUT
Expand All @@ -40,7 +40,7 @@ jobs:
echo "isSecurityPluginAvailable=False" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
fi
knn_plugin_url="https://aws.oss.sonatype.org/content/repositories/snapshots/org/opensearch/plugin/opensearch-knn/"$opensearch_version"/"
knn_plugin_url="https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/org/opensearch/plugin/opensearch-knn/"$opensearch_version"/"
knn_st=$(curl -s -o /dev/null -w "%{http_code}" $knn_plugin_url)
if [ "$knn_st" = "200" ]; then
echo "isKnnPluginAvailable=True" >> $GITHUB_OUTPUT
Expand Down
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://artifacts.opensearch.org/snapshots/lucene/" }
Expand Down Expand Up @@ -155,6 +156,7 @@ dependencies {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://artifacts.opensearch.org/snapshots/lucene/" }
Expand Down Expand Up @@ -978,7 +980,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 Down
Loading