From afa0b220660057d52975667a1c3650bc33c45d48 Mon Sep 17 00:00:00 2001 From: Goooler Date: Wed, 2 Jul 2025 17:06:04 +0800 Subject: [PATCH] Publish to Central Portal https://central.sonatype.org/news/20250326_ossrh_sunset/ https://github.com/gradle-nexus/publish-plugin?tab=readme-ov-file#publishing-to-maven-central-via-sonatype-central --- .github/workflows/deploy.yml | 8 ++++---- gradle/java-publish.gradle | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ffc164a461..4a4672be17 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,5 +1,5 @@ -# NEXUS_USER -# NEXUS_PASS64 (base64 NOTE: `base64` and `openssl base64` failed, had to use Java +# CENTRAL_PORTAL_USER +# CENTRAL_PORTAL_PASS64 (base64 NOTE: `base64` and `openssl base64` failed, had to use Java # byte[] data = "{{password}}".getBytes(StandardCharsets.UTF_8); # String encoded = new String(Base64.getEncoder().encode(data), StandardCharsets.UTF_8); # System.out.println(encoded); @@ -32,8 +32,8 @@ jobs: contents: write env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ORG_GRADLE_PROJECT_nexus_user: ${{ secrets.NEXUS_USER }} - ORG_GRADLE_PROJECT_nexus_pass64: ${{ secrets.NEXUS_PASS64 }} + ORG_GRADLE_PROJECT_central_portal_user: ${{ secrets.CENTRAL_PORTAL_USER }} + ORG_GRADLE_PROJECT_central_portal_pass64: ${{ secrets.CENTRAL_PORTAL_PASS64 }} ORG_GRADLE_PROJECT_gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }} ORG_GRADLE_PROJECT_gpg_key64: ${{ secrets.GPG_KEY64 }} steps: diff --git a/gradle/java-publish.gradle b/gradle/java-publish.gradle index baad061ea8..2c26a692f3 100644 --- a/gradle/java-publish.gradle +++ b/gradle/java-publish.gradle @@ -11,7 +11,7 @@ def decode64(String varName) { if (project.parent == null) { group = 'com.diffplug.spotless' - def pass = System.env['ORG_GRADLE_PROJECT_nexus_pass64'] + def pass = System.env['ORG_GRADLE_PROJECT_central_portal_pass64'] if (pass != null) { pass = pass.decodeBase64() } @@ -20,10 +20,10 @@ if (project.parent == null) { nexusPublishing { repositories { sonatype { - nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) - snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) - username = System.env['ORG_GRADLE_PROJECT_nexus_user'] - password = decode64('ORG_GRADLE_PROJECT_nexus_pass64') + nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) + snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/")) + username = System.env['ORG_GRADLE_PROJECT_central_portal_user'] + password = decode64('ORG_GRADLE_PROJECT_central_portal_pass64') } } }