From 1d848a5eced5c104773f1132db6f71271c003026 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 1 Mar 2023 16:04:05 -0800 Subject: [PATCH] Add publication of jars workflow. (#764) (#765) Signed-off-by: Yury-Fridlyand (cherry picked from commit 22b66d5da1d669697ced5736d56b1a7f737f5fb8) Co-authored-by: Yury-Fridlyand --- .github/workflows/maven-publish.yml | 2 +- client/build.gradle | 36 +++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 7ae9e11c48..79b116b64b 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -35,4 +35,4 @@ 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" - ./gradlew publishPluginZipPublicationToSnapshotsRepository + ./gradlew publishPluginZipPublicationToSnapshotsRepository publishJarsPublicationToSnapshotsRepository diff --git a/client/build.gradle b/client/build.gradle index 7982c3db77..82f74ebd57 100644 --- a/client/build.gradle +++ b/client/build.gradle @@ -69,6 +69,14 @@ publishing { name = 'staging' url = "${rootProject.buildDir}/local-staging-repo" } + maven { + name = "Snapshots" + url = "https://aws.oss.sonatype.org/content/repositories/snapshots" + credentials { + username "$System.env.SONATYPE_USERNAME" + password "$System.env.SONATYPE_PASSWORD" + } + } } publications { shadow(MavenPublication) { publication -> @@ -100,6 +108,34 @@ publishing { } } } + jars(MavenPublication) { publication -> + from components.java + + pom { + name = "OpenSearch Machine Learning Client" + packaging = "jar" + url = "https://github.com/opensearch-project/ml-commons" + description = "OpenSearch Machine Learning Client" + scm { + connection = "scm:git@github.com:opensearch-project/ml-commons.git" + developerConnection = "scm:git@github.com:opensearch-project/ml-commons.git" + url = "git@github.com:opensearch-project/ml-commons.git" + } + 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/ml-commons" + } + } + } + } + } }