From dbfc54e5db711ddbd9cf78df8117912832352e26 Mon Sep 17 00:00:00 2001 From: Gia Thuan Lam Date: Sun, 7 Sep 2025 19:34:15 +0000 Subject: [PATCH] Update Gradle nexus publish + release.yml to Central Sonatype. --- .github/workflows/{publish.yaml => publish.yml} | 0 .github/workflows/release.yml | 4 ++-- build.gradle.kts | 13 ++++++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) rename .github/workflows/{publish.yaml => publish.yml} (100%) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yml similarity index 100% rename from .github/workflows/publish.yaml rename to .github/workflows/publish.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5d5515f2..3087c297 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,8 +18,8 @@ jobs: uses: gradle/actions/setup-gradle@v4 - name: release env: - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + CENTRAL_SONATYPE_USERNAME: ${{ secrets.CENTRAL_SONATYPE_USERNAME }} + CENTRAL_SONATYPE_PASSWORD: ${{ secrets.CENTRAL_SONATYPE_PASSWORD }} GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} run: | diff --git a/build.gradle.kts b/build.gradle.kts index 99fa6980..8b8476da 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -139,7 +139,14 @@ subprojects { tasks.withType { onlyIf { System.getenv("GPG_PRIVATE_KEY") != null } } } -nexusPublishing.repositories.sonatype { - username.set(System.getenv("SONATYPE_USERNAME")) - password.set(System.getenv("SONATYPE_PASSWORD")) +// See https://github.com/gradle-nexus/publish-plugin. +nexusPublishing { + repositories { + sonatype { + nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) + snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/")) + username = System.getenv("CENTRAL_SONATYPE_USERNAME") + password = System.getenv("CENTRAL_SONATYPE_PASSWORD") + } + } }