From cbe82b1a5b89b49a528f8559d91d6317aeb581ac Mon Sep 17 00:00:00 2001 From: Rain Ramm Date: Tue, 29 Jul 2025 14:44:29 +0300 Subject: [PATCH] Move from Nexus OSSRH to Central Portal --- .github/scripts/publish.sh | 7 +++++++ .github/workflows/publish-packages.yml | 3 ++- README.md | 2 +- build.gradle | 2 +- deploy/getVersion.sh | 9 --------- deploy/injectGradleCredentials.sh | 5 ----- deploy/setSnapshotVersion.sh | 15 --------------- library.gradle | 4 ++-- 8 files changed, 13 insertions(+), 34 deletions(-) create mode 100755 .github/scripts/publish.sh delete mode 100755 deploy/getVersion.sh delete mode 100755 deploy/injectGradleCredentials.sh delete mode 100755 deploy/setSnapshotVersion.sh diff --git a/.github/scripts/publish.sh b/.github/scripts/publish.sh new file mode 100755 index 0000000..752a48e --- /dev/null +++ b/.github/scripts/publish.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -o errexit + +./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --info + +curl -X POST -H "Authorization: Bearer $(printf \"${ORG_GRADLE_PROJECT_mavenCentralUsername}:${ORG_GRADLE_PROJECT_mavenCentralPassword}\" | base64)" https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/ee.bitweb diff --git a/.github/workflows/publish-packages.yml b/.github/workflows/publish-packages.yml index fa7f430..7053eb9 100644 --- a/.github/workflows/publish-packages.yml +++ b/.github/workflows/publish-packages.yml @@ -3,6 +3,7 @@ name: Publish package to the Maven Central Repository on: release: types: [created] + workflow_dispatch: # Allow manual trigger as well (for testing only) jobs: publish: @@ -23,4 +24,4 @@ jobs: ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} ORG_GRADLE_PROJECT_signingKey: ${{ secrets.MAVEN_CENTRAL_SIGNING_KEY }} ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.MAVEN_CENTRAL_SIGNING_KEY_PASSWORD }} - run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --info + run: ./.github/scripts/deploy.sh diff --git a/README.md b/README.md index 0df78fa..b546d0a 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Library providing basic generic functionality required by any HTTP web service. ``` // https://mvnrepository.com/artifact/ee.bitweb/spring-core -implementation group: 'ee.bitweb', name: 'spring-core', version: '4.0.1' +implementation group: 'ee.bitweb', name: 'spring-core', version: '4.0.2' ``` Review available versions in [Maven Central](https://mvnrepository.com/artifact/ee.bitweb/spring-core). diff --git a/build.gradle b/build.gradle index f54991a..9c35493 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ plugins { } group 'ee.bitweb' -version '4.0.2' +version '4.0.3' java { sourceCompatibility = '17' } diff --git a/deploy/getVersion.sh b/deploy/getVersion.sh deleted file mode 100755 index 281dc2b..0000000 --- a/deploy/getVersion.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -o errexit - -function prop { - ./gradlew properties | grep "${1}" |cut -d':' -f2 -} - -echo $(prop 'version') diff --git a/deploy/injectGradleCredentials.sh b/deploy/injectGradleCredentials.sh deleted file mode 100755 index 2fee4b2..0000000 --- a/deploy/injectGradleCredentials.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -set -o errexit - -echo -e "repoUser=$1" >> "$3" -echo -e "repoPassword=$2" >> "$3" diff --git a/deploy/setSnapshotVersion.sh b/deploy/setSnapshotVersion.sh deleted file mode 100755 index 0662764..0000000 --- a/deploy/setSnapshotVersion.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -set -o errexit - -if [[ "$OSTYPE" == "darwin"* ]]; then - echo "Not meant to be used on Mac OS!" - exit 1 -fi - -CURRENT=$(./deploy/getVersion.sh) - -NEW_VERSION="$CURRENT"-SNAPSHOT - -echo "Change version from $CURRENT to $NEW_VERSION" - -sed -i "s/version '$CURRENT'/version '$NEW_VERSION'/" build.gradle >> build.gradle diff --git a/library.gradle b/library.gradle index 85d0189..ad3bc43 100644 --- a/library.gradle +++ b/library.gradle @@ -70,8 +70,8 @@ nexusPublishing { repositories { if (project.hasProperty('mavenCentralUsername') & project.hasProperty('mavenCentralPassword')) { sonatype { - nexusUrl.set(uri("https://oss.sonatype.org/service/local/")) - snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots")) + nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) + snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/")) username = project.mavenCentralUsername password = project.mavenCentralPassword }