From b55fb8fc9aef485fd16a5550c1dfbaa9a16c5f3d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 4 Sep 2024 20:42:38 +0000 Subject: [PATCH] Add configuration for publishing snapshot (#90) (#92) (cherry picked from commit 7966198a68132503db0e0c228ce54950adb2a006) Signed-off-by: Chenyang Ji (cherry picked from commit 0f08e079740de6bea4f899829b5157ab9ad9cb74) Signed-off-by: github-actions[bot] --- .github/workflows/maven-publish.yml | 4 ---- build.gradle | 31 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index aabc13d4..6c30bcf9 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -36,9 +36,5 @@ jobs: 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" - # For JS-SPI jar - ./gradlew publishShadowPublicationToSnapshotsRepository - # For JS jar - ./gradlew publishNebulaPublicationToSnapshotsRepository # For JS plugin zip ./gradlew publishPluginZipPublicationToSnapshotsRepository diff --git a/build.gradle b/build.gradle index a9028bd9..59486bc1 100644 --- a/build.gradle +++ b/build.gradle @@ -81,6 +81,37 @@ publishing { } } } + publications { + pluginZip(MavenPublication) { publication -> + pom { + name = pluginName + description = pluginDescription + groupId = "org.opensearch.plugin" + licenses { + license { + name = "The Apache License, Version 2.0" + url = "http://www.apache.org/licenses/LICENSE-2.0.txt" + } + } + developers { + developer { + name = "OpenSearch" + url = "https://github.com/opensearch-project/opensearch-plugin-template-java" + } + } + } + } + } + repositories { + maven { + name = "Snapshots" + url = "https://aws.oss.sonatype.org/content/repositories/snapshots" + credentials { + username "$System.env.SONATYPE_USERNAME" + password "$System.env.SONATYPE_PASSWORD" + } + } + } } checkstyle {