From f9b5fd7c09819005b73d826cc9910a5b3655a791 Mon Sep 17 00:00:00 2001 From: pkryshtop <97191009+sl-pkryshtop@users.noreply.github.com> Date: Wed, 6 Aug 2025 17:53:03 +0300 Subject: [PATCH] fix: deploy to Central Publisher Portal instead of sonatype OSSRH (#120) Co-authored-by: pkryshtop --- .circleci/config.yml | 4 +++- .circleci/release.sh | 11 ++++++++++- .circleci/settings.xml | 6 +++--- pom.xml | 45 ++++++++++++++++++++++++++++++++++++++---- 4 files changed, 57 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7ce72f20..fe60771c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,4 +49,6 @@ workflows: - test filters: branches: - only: master + only: + - master + - deploy-test diff --git a/.circleci/release.sh b/.circleci/release.sh index 9099d2ca..3ac297ac 100755 --- a/.circleci/release.sh +++ b/.circleci/release.sh @@ -9,4 +9,13 @@ if ! ./mvnw -Prelease conventional-commits:validate; then fi ./mvnw -B -Prelease -DskipTests -Darguments='-DskipTests' -s .circleci/settings.xml conventional-commits:version release:prepare -./mvnw -B -DskipTests -Darguments=-DskipTests -s .circleci/settings.xml release:perform + +# Get the tag created by release:prepare +TAG=$(git describe --tags --abbrev=0) +echo "Deploying tag: $TAG" + +# Checkout the tagged version +git checkout $TAG + +# Deploy using central-publishing-maven-plugin +./mvnw -B -Prelease -DskipTests -s .circleci/settings.xml clean deploy diff --git a/.circleci/settings.xml b/.circleci/settings.xml index ad95e21c..3051899c 100644 --- a/.circleci/settings.xml +++ b/.circleci/settings.xml @@ -18,9 +18,9 @@ - sonatype-oss-staging - ${env.SONATYPE_USERNAME} - ${env.SONATYPE_PASSWORD} + central + ${env.CENTRAL_SONATYPE_USERNAME} + ${env.CENTRAL_SONATYPE_PASSWORD} diff --git a/pom.xml b/pom.xml index 32f461f0..c59381c1 100644 --- a/pom.xml +++ b/pom.xml @@ -207,10 +207,6 @@ - - sonatype-oss-staging - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - github https://maven.pkg.github.com/smartling/java-api-sdk @@ -238,6 +234,47 @@ v@{project.version} false ci: + + prepare + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.1.1 + + + attach-javadocs + + jar + + + + + + org.sonatype.central + central-publishing-maven-plugin + 0.8.0 + true + + central + false + uploaded + required + Java API SDK (${project.version})