From 065cc4f8df0f94dc924ddd2613b69d851a39b72d Mon Sep 17 00:00:00 2001 From: Alexey Havrilyuk Date: Wed, 30 Jul 2025 12:36:04 +0200 Subject: [PATCH 01/24] added manual deployment(release) step for the Publisher Portal --- .github/workflows/publishing2sonatype.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publishing2sonatype.yml b/.github/workflows/publishing2sonatype.yml index c36a5d7a..adcbd79e 100644 --- a/.github/workflows/publishing2sonatype.yml +++ b/.github/workflows/publishing2sonatype.yml @@ -33,6 +33,11 @@ jobs: run: | sed -i -e 's|.*sonatypeUsername.*| username = "${{ secrets.SUSER }}"|' ./build.gradle sed -i -e 's|.*sonatypePassword.*| password = "${{ secrets.SPASSWORD }}"|' ./build.gradle - - name: Publish to Sonatype + - name: Sonatype Publish run: | - ./gradlew publishJarPublicationToStagingRepository \ No newline at end of file + ./gradlew publishJarPublicationToStagingRepository + BEARER=$(printf "${secrets.SUSER}:${secrets.SPASSWORD}" | base64) + curl --request POST \ + --verbose \ + --header "Authorization: Bearer ${BEARER}" \ + https://central.sonatype.com/manual/upload/defaultRepository/${secrets.SREPO_ID} From db44a11a95616a11a658090fa088409ae96ae39f Mon Sep 17 00:00:00 2001 From: Alexey Havrilyuk Date: Wed, 30 Jul 2025 13:45:35 +0200 Subject: [PATCH 02/24] allow to run from branch for testing --- .github/workflows/publishing2sonatype.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publishing2sonatype.yml b/.github/workflows/publishing2sonatype.yml index adcbd79e..b4e5d6e1 100644 --- a/.github/workflows/publishing2sonatype.yml +++ b/.github/workflows/publishing2sonatype.yml @@ -1,7 +1,7 @@ name: Publishing to Sonatype on: - release: - types: [published] +# release: +# types: [published] env: GH_TOKEN: ${{ github.token }} From b7ef1399f4fbbbcd8e5ffd2220e4cf68db89c54b Mon Sep 17 00:00:00 2001 From: Alexey Havrilyuk Date: Wed, 30 Jul 2025 13:53:45 +0200 Subject: [PATCH 03/24] on push publish for testing --- .github/workflows/publishing2sonatype.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publishing2sonatype.yml b/.github/workflows/publishing2sonatype.yml index b4e5d6e1..5a76ab7e 100644 --- a/.github/workflows/publishing2sonatype.yml +++ b/.github/workflows/publishing2sonatype.yml @@ -1,5 +1,6 @@ name: Publishing to Sonatype on: + push: # release: # types: [published] From 73eacd62e2d381f317d660581dda9bd6db723991 Mon Sep 17 00:00:00 2001 From: Alexey Havrilyuk Date: Wed, 30 Jul 2025 14:04:08 +0200 Subject: [PATCH 04/24] fixed some vars --- .github/workflows/publishing2sonatype.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publishing2sonatype.yml b/.github/workflows/publishing2sonatype.yml index 5a76ab7e..befa8092 100644 --- a/.github/workflows/publishing2sonatype.yml +++ b/.github/workflows/publishing2sonatype.yml @@ -37,8 +37,8 @@ jobs: - name: Sonatype Publish run: | ./gradlew publishJarPublicationToStagingRepository - BEARER=$(printf "${secrets.SUSER}:${secrets.SPASSWORD}" | base64) + BEARER=$(printf "${{ secrets.SUSER }}:${{ secrets.SPASSWORD }}" | base64) curl --request POST \ --verbose \ --header "Authorization: Bearer ${BEARER}" \ - https://central.sonatype.com/manual/upload/defaultRepository/${secrets.SREPO_ID} + https://central.sonatype.com/manual/upload/defaultRepository/${{ secrets.SREPO_ID }} From a74cc0775b203ba696e9313814333b254d45535f Mon Sep 17 00:00:00 2001 From: Alexey Havrilyuk Date: Wed, 30 Jul 2025 14:23:19 +0200 Subject: [PATCH 05/24] sonatype host changed --- .github/workflows/publishing2sonatype.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publishing2sonatype.yml b/.github/workflows/publishing2sonatype.yml index befa8092..eceed491 100644 --- a/.github/workflows/publishing2sonatype.yml +++ b/.github/workflows/publishing2sonatype.yml @@ -41,4 +41,4 @@ jobs: curl --request POST \ --verbose \ --header "Authorization: Bearer ${BEARER}" \ - https://central.sonatype.com/manual/upload/defaultRepository/${{ secrets.SREPO_ID }} + https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/${{ secrets.SREPO_ID }} From 88a12d779edde045aaa9ba06cb8f9120d4038838 Mon Sep 17 00:00:00 2001 From: Alexey Havrilyuk Date: Wed, 30 Jul 2025 14:34:33 +0200 Subject: [PATCH 06/24] sonatype maven repo name changed --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 587fe65e..05dbb6d3 100644 --- a/build.gradle +++ b/build.gradle @@ -157,7 +157,7 @@ publishing { repositories { maven { - name 'staging' + name 'ossrh-staging-api' url = 'https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/' credentials { From 2de68ae258b1335d1060c568247adda2c77dc7e1 Mon Sep 17 00:00:00 2001 From: Alexey Havrilyuk Date: Wed, 30 Jul 2025 14:57:15 +0200 Subject: [PATCH 07/24] sonatype maven repo name changed --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 05dbb6d3..587fe65e 100644 --- a/build.gradle +++ b/build.gradle @@ -157,7 +157,7 @@ publishing { repositories { maven { - name 'ossrh-staging-api' + name 'staging' url = 'https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/' credentials { From a463a1551b10040ebe7a7a18a976056dbedde235 Mon Sep 17 00:00:00 2001 From: Alexey Havrilyuk Date: Wed, 30 Jul 2025 15:02:38 +0200 Subject: [PATCH 08/24] debug flag for gradlew --- .github/workflows/publishing2sonatype.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publishing2sonatype.yml b/.github/workflows/publishing2sonatype.yml index eceed491..42f2de22 100644 --- a/.github/workflows/publishing2sonatype.yml +++ b/.github/workflows/publishing2sonatype.yml @@ -36,7 +36,7 @@ jobs: sed -i -e 's|.*sonatypePassword.*| password = "${{ secrets.SPASSWORD }}"|' ./build.gradle - name: Sonatype Publish run: | - ./gradlew publishJarPublicationToStagingRepository + ./gradlew -S publishJarPublicationToStagingRepository BEARER=$(printf "${{ secrets.SUSER }}:${{ secrets.SPASSWORD }}" | base64) curl --request POST \ --verbose \ From 3ee96566460d7a939afe773513b06bffe7cce72d Mon Sep 17 00:00:00 2001 From: Alexey Havrilyuk Date: Wed, 30 Jul 2025 15:43:48 +0200 Subject: [PATCH 09/24] Portal Publisher API test --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 587fe65e..b6409936 100644 --- a/build.gradle +++ b/build.gradle @@ -158,7 +158,7 @@ publishing { repositories { maven { name 'staging' - url = 'https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/' + url = 'https://central.sonatype.com/api/v1/publisher/deployments/download/' credentials { username = "${sonatypeUsername}" From c18e5210e9fe2dc7a3b341593fbcd545dfe64951 Mon Sep 17 00:00:00 2001 From: Alexey Havrilyuk Date: Wed, 30 Jul 2025 16:13:45 +0200 Subject: [PATCH 10/24] Portal Publisher API auth with Bearer --- .github/workflows/publishing2sonatype.yml | 12 +++++++----- build.gradle | 7 ++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publishing2sonatype.yml b/.github/workflows/publishing2sonatype.yml index 42f2de22..9c253790 100644 --- a/.github/workflows/publishing2sonatype.yml +++ b/.github/workflows/publishing2sonatype.yml @@ -36,9 +36,11 @@ jobs: sed -i -e 's|.*sonatypePassword.*| password = "${{ secrets.SPASSWORD }}"|' ./build.gradle - name: Sonatype Publish run: | - ./gradlew -S publishJarPublicationToStagingRepository BEARER=$(printf "${{ secrets.SUSER }}:${{ secrets.SPASSWORD }}" | base64) - curl --request POST \ - --verbose \ - --header "Authorization: Bearer ${BEARER}" \ - https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/${{ secrets.SREPO_ID }} + echo "stagingAuthHeaderName=Authorization" >> ./gradle.properties + echo "stagingAuthHeaderValuee=Bearer ${BEARER}" >> ./gradle.properties + ./gradlew -S publishJarPublicationToStagingRepository +# curl --request POST \ +# --verbose \ +# --header "Authorization: Bearer ${BEARER}" \ +# https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/${{ secrets.SREPO_ID }} diff --git a/build.gradle b/build.gradle index b6409936..353061d7 100644 --- a/build.gradle +++ b/build.gradle @@ -160,10 +160,11 @@ publishing { name 'staging' url = 'https://central.sonatype.com/api/v1/publisher/deployments/download/' - credentials { - username = "${sonatypeUsername}" - password = "${sonatypePassword}" + credentials(HttpHeaderCredentials) + authentication { + header(HttpHeaderAuthentication) } + } } } From f57308220e4c0290ea81939d60c8e72b8d954bb9 Mon Sep 17 00:00:00 2001 From: Alexey Havrilyuk Date: Wed, 30 Jul 2025 16:22:23 +0200 Subject: [PATCH 11/24] auth with Bearer attempt --- .github/workflows/publishing2sonatype.yml | 2 +- build.gradle | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publishing2sonatype.yml b/.github/workflows/publishing2sonatype.yml index 9c253790..e9cb5b9c 100644 --- a/.github/workflows/publishing2sonatype.yml +++ b/.github/workflows/publishing2sonatype.yml @@ -38,7 +38,7 @@ jobs: run: | BEARER=$(printf "${{ secrets.SUSER }}:${{ secrets.SPASSWORD }}" | base64) echo "stagingAuthHeaderName=Authorization" >> ./gradle.properties - echo "stagingAuthHeaderValuee=Bearer ${BEARER}" >> ./gradle.properties + echo "stagingAuthHeaderValue=Bearer ${BEARER}" >> ./gradle.properties ./gradlew -S publishJarPublicationToStagingRepository # curl --request POST \ # --verbose \ diff --git a/build.gradle b/build.gradle index 353061d7..26ea097d 100644 --- a/build.gradle +++ b/build.gradle @@ -160,9 +160,9 @@ publishing { name 'staging' url = 'https://central.sonatype.com/api/v1/publisher/deployments/download/' - credentials(HttpHeaderCredentials) + credentials(AuthHeaderValue) authentication { - header(HttpHeaderAuthentication) + header(AuthHeaderName) } } From c68a5b41e9f6ff5d8ec9e45cc6529f7bd34c3daa Mon Sep 17 00:00:00 2001 From: Alexey Havrilyuk Date: Wed, 30 Jul 2025 16:26:08 +0200 Subject: [PATCH 12/24] back to basic auth attempt --- .github/workflows/publishing2sonatype.yml | 4 ++-- build.gradle | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publishing2sonatype.yml b/.github/workflows/publishing2sonatype.yml index e9cb5b9c..06857f16 100644 --- a/.github/workflows/publishing2sonatype.yml +++ b/.github/workflows/publishing2sonatype.yml @@ -37,8 +37,8 @@ jobs: - name: Sonatype Publish run: | BEARER=$(printf "${{ secrets.SUSER }}:${{ secrets.SPASSWORD }}" | base64) - echo "stagingAuthHeaderName=Authorization" >> ./gradle.properties - echo "stagingAuthHeaderValue=Bearer ${BEARER}" >> ./gradle.properties +# echo "stagingAuthHeaderName=Authorization" >> ./gradle.properties +# echo "stagingAuthHeaderValue=Bearer ${BEARER}" >> ./gradle.properties ./gradlew -S publishJarPublicationToStagingRepository # curl --request POST \ # --verbose \ diff --git a/build.gradle b/build.gradle index 26ea097d..0c97d777 100644 --- a/build.gradle +++ b/build.gradle @@ -158,13 +158,12 @@ publishing { repositories { maven { name 'staging' - url = 'https://central.sonatype.com/api/v1/publisher/deployments/download/' + url = 'https://central.sonatype.com/api/v1/publisher' - credentials(AuthHeaderValue) - authentication { - header(AuthHeaderName) + credentials { + username = "${sonatypeUsername}" + password = "${sonatypePassword}" } - } } } From 09e4adb7fa2af2e85c39de9ccdcc3bf9c3cb4419 Mon Sep 17 00:00:00 2001 From: Alexey Havrilyuk Date: Wed, 30 Jul 2025 16:27:29 +0200 Subject: [PATCH 13/24] fixed yml --- .github/workflows/publishing2sonatype.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/publishing2sonatype.yml b/.github/workflows/publishing2sonatype.yml index 06857f16..75e931cf 100644 --- a/.github/workflows/publishing2sonatype.yml +++ b/.github/workflows/publishing2sonatype.yml @@ -36,10 +36,8 @@ jobs: sed -i -e 's|.*sonatypePassword.*| password = "${{ secrets.SPASSWORD }}"|' ./build.gradle - name: Sonatype Publish run: | - BEARER=$(printf "${{ secrets.SUSER }}:${{ secrets.SPASSWORD }}" | base64) -# echo "stagingAuthHeaderName=Authorization" >> ./gradle.properties -# echo "stagingAuthHeaderValue=Bearer ${BEARER}" >> ./gradle.properties ./gradlew -S publishJarPublicationToStagingRepository +# BEARER=$(printf "${{ secrets.SUSER }}:${{ secrets.SPASSWORD }}" | base64) # curl --request POST \ # --verbose \ # --header "Authorization: Bearer ${BEARER}" \ From 0d11634160ec8c9035df1a69ab12dc7d9a403836 Mon Sep 17 00:00:00 2001 From: Alexey Havrilyuk Date: Wed, 30 Jul 2025 16:31:36 +0200 Subject: [PATCH 14/24] publisher url changed --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 0c97d777..b6409936 100644 --- a/build.gradle +++ b/build.gradle @@ -158,7 +158,7 @@ publishing { repositories { maven { name 'staging' - url = 'https://central.sonatype.com/api/v1/publisher' + url = 'https://central.sonatype.com/api/v1/publisher/deployments/download/' credentials { username = "${sonatypeUsername}" From 88d9c207f98d75969cf2eec625979b9250ff0c75 Mon Sep 17 00:00:00 2001 From: Alexey Havrilyuk Date: Wed, 30 Jul 2025 16:37:42 +0200 Subject: [PATCH 15/24] back to ossrh --- .github/workflows/publishing2sonatype.yml | 10 +++++----- build.gradle | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publishing2sonatype.yml b/.github/workflows/publishing2sonatype.yml index 75e931cf..42f2de22 100644 --- a/.github/workflows/publishing2sonatype.yml +++ b/.github/workflows/publishing2sonatype.yml @@ -37,8 +37,8 @@ jobs: - name: Sonatype Publish run: | ./gradlew -S publishJarPublicationToStagingRepository -# BEARER=$(printf "${{ secrets.SUSER }}:${{ secrets.SPASSWORD }}" | base64) -# curl --request POST \ -# --verbose \ -# --header "Authorization: Bearer ${BEARER}" \ -# https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/${{ secrets.SREPO_ID }} + BEARER=$(printf "${{ secrets.SUSER }}:${{ secrets.SPASSWORD }}" | base64) + curl --request POST \ + --verbose \ + --header "Authorization: Bearer ${BEARER}" \ + https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/${{ secrets.SREPO_ID }} diff --git a/build.gradle b/build.gradle index b6409936..587fe65e 100644 --- a/build.gradle +++ b/build.gradle @@ -158,7 +158,7 @@ publishing { repositories { maven { name 'staging' - url = 'https://central.sonatype.com/api/v1/publisher/deployments/download/' + url = 'https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/' credentials { username = "${sonatypeUsername}" From b6d4e57f6d72d258322d50bf95e581ffaea09ad7 Mon Sep 17 00:00:00 2001 From: Alexey Havrilyuk Date: Wed, 30 Jul 2025 17:03:57 +0200 Subject: [PATCH 16/24] nexus plugin attempt --- build.gradle | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 587fe65e..96e13469 100644 --- a/build.gradle +++ b/build.gradle @@ -3,6 +3,7 @@ apply plugin: 'java' apply plugin: 'maven-publish' apply plugin: 'signing' apply plugin: 'java-library-distribution' +apply plugin: 'io.github.gradle-nexus.publish-plugin' group = 'com.siftscience' version = '3.21.2' @@ -154,20 +155,35 @@ publishing { } } } +} +nexusPublishing { repositories { - maven { - name 'staging' - url = 'https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/' - - credentials { - username = "${sonatypeUsername}" - password = "${sonatypePassword}" - } + sonatype() + } + repositories { + // see https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#configuration + sonatype { +// nexusUrl = uri("https://your-server.com/staging") + nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) + username = "${sonatypeUsername}" // defaults to project.properties["myNexusUsername"] + password = "${sonatypePassword}" // defaults to project.properties["myNexusPassword"] } } } +// repositories { +// maven { +// name 'staging' +// url = 'https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/' +// +// credentials { +// username = "${sonatypeUsername}" +// password = "${sonatypePassword}" +// } +// } +// } + model { tasks.publishJarPublicationToStagingRepository { dependsOn(project.tasks.signArchives) From 96f32a9e208c814ae78c54ac5cc83d92f0b81398 Mon Sep 17 00:00:00 2001 From: Alexey Havrilyuk Date: Wed, 30 Jul 2025 17:21:47 +0200 Subject: [PATCH 17/24] nexus plugin job attempt --- .github/workflows/publishing2sonatype.yml | 12 ++++++------ build.gradle | 5 +++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publishing2sonatype.yml b/.github/workflows/publishing2sonatype.yml index 42f2de22..2b20cc5f 100644 --- a/.github/workflows/publishing2sonatype.yml +++ b/.github/workflows/publishing2sonatype.yml @@ -36,9 +36,9 @@ jobs: sed -i -e 's|.*sonatypePassword.*| password = "${{ secrets.SPASSWORD }}"|' ./build.gradle - name: Sonatype Publish run: | - ./gradlew -S publishJarPublicationToStagingRepository - BEARER=$(printf "${{ secrets.SUSER }}:${{ secrets.SPASSWORD }}" | base64) - curl --request POST \ - --verbose \ - --header "Authorization: Bearer ${BEARER}" \ - https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/${{ secrets.SREPO_ID }} + ./gradlew -S releaseSonatypeStagingRepository +# BEARER=$(printf "${{ secrets.SUSER }}:${{ secrets.SPASSWORD }}" | base64) +# curl --request POST \ +# --verbose \ +# --header "Authorization: Bearer ${BEARER}" \ +# https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/${{ secrets.SREPO_ID }} diff --git a/build.gradle b/build.gradle index 96e13469..b7e13b2e 100644 --- a/build.gradle +++ b/build.gradle @@ -3,8 +3,9 @@ apply plugin: 'java' apply plugin: 'maven-publish' apply plugin: 'signing' apply plugin: 'java-library-distribution' -apply plugin: 'io.github.gradle-nexus.publish-plugin' - +plugins { + id("io.github.gradle-nexus.publish-plugin") version "2.0.0" +} group = 'com.siftscience' version = '3.21.2' From f9d3b2b697c00f8b7b633934d71824ee75d0e11a Mon Sep 17 00:00:00 2001 From: Alexey Havrilyuk Date: Wed, 30 Jul 2025 18:05:55 +0200 Subject: [PATCH 18/24] different plugin and job attempt --- .github/workflows/publishing2sonatype.yml | 3 +- build.gradle | 51 +++++++++++------------ 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/publishing2sonatype.yml b/.github/workflows/publishing2sonatype.yml index 2b20cc5f..403b7d7a 100644 --- a/.github/workflows/publishing2sonatype.yml +++ b/.github/workflows/publishing2sonatype.yml @@ -36,7 +36,8 @@ jobs: sed -i -e 's|.*sonatypePassword.*| password = "${{ secrets.SPASSWORD }}"|' ./build.gradle - name: Sonatype Publish run: | - ./gradlew -S releaseSonatypeStagingRepository + ./gradlew publishToSonatype +# ./gradlew -S releaseSonatypeStagingRepository # BEARER=$(printf "${{ secrets.SUSER }}:${{ secrets.SPASSWORD }}" | base64) # curl --request POST \ # --verbose \ diff --git a/build.gradle b/build.gradle index b7e13b2e..4163509f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,18 @@ +buildscript { + repositories { + jcenter() + } +} + +plugins { + id 'io.github.gradle-nexus.publish-plugin' version '2.0.0' +} apply plugin: 'java' apply plugin: 'maven-publish' apply plugin: 'signing' apply plugin: 'java-library-distribution' -plugins { - id("io.github.gradle-nexus.publish-plugin") version "2.0.0" -} + group = 'com.siftscience' version = '3.21.2' @@ -14,12 +21,12 @@ repositories { } compileJava { - sourceCompatibility = 1.8 - targetCompatibility = 1.8 + sourceCompatibility = 1.8 + targetCompatibility = 1.8 } compileTestJava { - sourceCompatibility = 1.8 + sourceCompatibility = 1.8 } dependencies { @@ -33,12 +40,6 @@ dependencies { implementation 'commons-codec:commons-codec:1.19.0' } -buildscript { - repositories { - jcenter() - } -} - task sourceJar(type: Jar) { archiveClassifier.set("sources") from sourceSets.main.allSource @@ -156,12 +157,20 @@ publishing { } } } +// repositories { +// maven { +// name 'staging' +// url = 'https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/' +// +// credentials { +// username = "${sonatypeUsername}" +// password = "${sonatypePassword}" +// } +// } +// } } nexusPublishing { - repositories { - sonatype() - } repositories { // see https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#configuration sonatype { @@ -173,17 +182,7 @@ nexusPublishing { } } -// repositories { -// maven { -// name 'staging' -// url = 'https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/' -// -// credentials { -// username = "${sonatypeUsername}" -// password = "${sonatypePassword}" -// } -// } -// } + model { tasks.publishJarPublicationToStagingRepository { From d0a8b69f1c2183cbf23d09817c6a4fa7a0cb6ad8 Mon Sep 17 00:00:00 2001 From: Alexey Havrilyuk Date: Wed, 30 Jul 2025 18:09:29 +0200 Subject: [PATCH 19/24] nexus plugin creds --- .github/workflows/publishing2sonatype.yml | 2 ++ build.gradle | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publishing2sonatype.yml b/.github/workflows/publishing2sonatype.yml index 403b7d7a..e33f1b10 100644 --- a/.github/workflows/publishing2sonatype.yml +++ b/.github/workflows/publishing2sonatype.yml @@ -36,6 +36,8 @@ jobs: sed -i -e 's|.*sonatypePassword.*| password = "${{ secrets.SPASSWORD }}"|' ./build.gradle - name: Sonatype Publish run: | + echo "myNexusUsername=${{ secrets.SUSER }}" >> ./gradle.properties + echo "myNexusPassword=${{ secrets.SPASSWORD }}" >> ./gradle.properties ./gradlew publishToSonatype # ./gradlew -S releaseSonatypeStagingRepository # BEARER=$(printf "${{ secrets.SUSER }}:${{ secrets.SPASSWORD }}" | base64) diff --git a/build.gradle b/build.gradle index 4163509f..b75db20f 100644 --- a/build.gradle +++ b/build.gradle @@ -176,8 +176,8 @@ nexusPublishing { sonatype { // nexusUrl = uri("https://your-server.com/staging") nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) - username = "${sonatypeUsername}" // defaults to project.properties["myNexusUsername"] - password = "${sonatypePassword}" // defaults to project.properties["myNexusPassword"] +// username = "${sonatypeUsername}" // defaults to project.properties["myNexusUsername"] +// password = "${sonatypePassword}" // defaults to project.properties["myNexusPassword"] } } } From 0821ad5302e8eee3824e79e452cb159893af65aa Mon Sep 17 00:00:00 2001 From: Alexey Havrilyuk Date: Wed, 30 Jul 2025 18:24:36 +0200 Subject: [PATCH 20/24] nexus plugin last attempt --- build.gradle | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index b75db20f..5f9e6884 100644 --- a/build.gradle +++ b/build.gradle @@ -5,6 +5,7 @@ buildscript { } plugins { +// id 'org.jreleaser' version '1.19.0' id 'io.github.gradle-nexus.publish-plugin' version '2.0.0' } @@ -16,6 +17,11 @@ apply plugin: 'java-library-distribution' group = 'com.siftscience' version = '3.21.2' +java { + withJavadocJar() + withSourcesJar() +} + repositories { mavenCentral() } @@ -157,6 +163,12 @@ publishing { } } } + repositories { + maven { + url = layout.buildDirectory.dir('staging-deploy') + } + } +} // repositories { // maven { // name 'staging' @@ -168,7 +180,7 @@ publishing { // } // } // } -} + nexusPublishing { repositories { @@ -178,17 +190,17 @@ nexusPublishing { nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) // username = "${sonatypeUsername}" // defaults to project.properties["myNexusUsername"] // password = "${sonatypePassword}" // defaults to project.properties["myNexusPassword"] + username = "ZxC3zG" + password = "O5zzMmghqUpz5ggAsob74s4qKDKvjE6zW" } } } - - -model { - tasks.publishJarPublicationToStagingRepository { - dependsOn(project.tasks.signArchives) - } -} +//model { +// tasks.publishJarPublicationToStagingRepository { +// dependsOn(project.tasks.signArchives) +// } +//} distributions { main { From e73243c0f84de009730b5cc63acb7e610164dc44 Mon Sep 17 00:00:00 2001 From: Alexey Havrilyuk Date: Wed, 30 Jul 2025 18:32:55 +0200 Subject: [PATCH 21/24] nexus plugin 1 more attempt --- .github/workflows/publishing2sonatype.yml | 4 ++-- build.gradle | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publishing2sonatype.yml b/.github/workflows/publishing2sonatype.yml index e33f1b10..aa25c565 100644 --- a/.github/workflows/publishing2sonatype.yml +++ b/.github/workflows/publishing2sonatype.yml @@ -36,8 +36,8 @@ jobs: sed -i -e 's|.*sonatypePassword.*| password = "${{ secrets.SPASSWORD }}"|' ./build.gradle - name: Sonatype Publish run: | - echo "myNexusUsername=${{ secrets.SUSER }}" >> ./gradle.properties - echo "myNexusPassword=${{ secrets.SPASSWORD }}" >> ./gradle.properties + ORG_GRADLE_PROJECT_sonatypeUsername=$(echo "sonatypeUsername=${{ secrets.SUSER }}") + ORG_GRADLE_PROJECT_sonatypePassword=$(echo "sonatypePassword=${{ secrets.SPASSWORD }}") ./gradlew publishToSonatype # ./gradlew -S releaseSonatypeStagingRepository # BEARER=$(printf "${{ secrets.SUSER }}:${{ secrets.SPASSWORD }}" | base64) diff --git a/build.gradle b/build.gradle index 5f9e6884..dbd8b3da 100644 --- a/build.gradle +++ b/build.gradle @@ -186,12 +186,7 @@ nexusPublishing { repositories { // see https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#configuration sonatype { -// nexusUrl = uri("https://your-server.com/staging") nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) -// username = "${sonatypeUsername}" // defaults to project.properties["myNexusUsername"] -// password = "${sonatypePassword}" // defaults to project.properties["myNexusPassword"] - username = "ZxC3zG" - password = "O5zzMmghqUpz5ggAsob74s4qKDKvjE6zW" } } } From 6c04373002012567ffec18ee99ed0a1521daeca0 Mon Sep 17 00:00:00 2001 From: Alexey Havrilyuk Date: Wed, 30 Jul 2025 18:37:30 +0200 Subject: [PATCH 22/24] nexus plugin attempt --- build.gradle | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index dbd8b3da..4074546e 100644 --- a/build.gradle +++ b/build.gradle @@ -163,11 +163,11 @@ publishing { } } } - repositories { - maven { - url = layout.buildDirectory.dir('staging-deploy') - } - } +// repositories { +// maven { +// url = layout.buildDirectory.dir('staging-deploy') +// } +// } } // repositories { // maven { From 1c0b336e0473f75a2eef979f604bee6c9fbb6699 Mon Sep 17 00:00:00 2001 From: Alexey Havrilyuk Date: Wed, 30 Jul 2025 18:47:29 +0200 Subject: [PATCH 23/24] jreleaser plugin attempt --- .github/workflows/publishing2sonatype.yml | 8 +++-- build.gradle | 42 ++++++++++++++++------- 2 files changed, 35 insertions(+), 15 deletions(-) diff --git a/.github/workflows/publishing2sonatype.yml b/.github/workflows/publishing2sonatype.yml index aa25c565..c5c58bd1 100644 --- a/.github/workflows/publishing2sonatype.yml +++ b/.github/workflows/publishing2sonatype.yml @@ -36,9 +36,11 @@ jobs: sed -i -e 's|.*sonatypePassword.*| password = "${{ secrets.SPASSWORD }}"|' ./build.gradle - name: Sonatype Publish run: | - ORG_GRADLE_PROJECT_sonatypeUsername=$(echo "sonatypeUsername=${{ secrets.SUSER }}") - ORG_GRADLE_PROJECT_sonatypePassword=$(echo "sonatypePassword=${{ secrets.SPASSWORD }}") - ./gradlew publishToSonatype + touch ~/.jreleaser/config.toml + echo "JRELEASER_NEXUS2_USERNAME='${{ secrets.SUSER }}'" >> ~/.jreleaser/config.toml + echo "JRELEASER_NEXUS2_PASSWORD='${{ secrets.SPASSWORD }}'" >> ~/.jreleaser/config.toml + ./gradlew publish +# ./gradlew jreleaserDeploy # ./gradlew -S releaseSonatypeStagingRepository # BEARER=$(printf "${{ secrets.SUSER }}:${{ secrets.SPASSWORD }}" | base64) # curl --request POST \ diff --git a/build.gradle b/build.gradle index 4074546e..3d99fba7 100644 --- a/build.gradle +++ b/build.gradle @@ -5,8 +5,8 @@ buildscript { } plugins { -// id 'org.jreleaser' version '1.19.0' - id 'io.github.gradle-nexus.publish-plugin' version '2.0.0' + id 'org.jreleaser' version '1.19.0' +// id 'io.github.gradle-nexus.publish-plugin' version '2.0.0' } apply plugin: 'java' @@ -163,11 +163,11 @@ publishing { } } } -// repositories { -// maven { -// url = layout.buildDirectory.dir('staging-deploy') -// } -// } + repositories { + maven { + url = layout.buildDirectory.dir('staging-deploy') + } + } } // repositories { // maven { @@ -182,11 +182,29 @@ publishing { // } -nexusPublishing { - repositories { - // see https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#configuration - sonatype { - nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) +//nexusPublishing { +// repositories { +// // see https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#configuration +// sonatype { +// nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) +// } +// } +//} + +jreleaser { + signing { + active = 'ALWAYS' + armored = true + } + deploy { + maven { + mavenCentral { + sonatype { + active = 'ALWAYS' + url = 'https://central.sonatype.com/api/v1/publisher' + stagingRepository('build/staging-deploy') + } + } } } } From 1312104360513b315300acd397015a5f1c782dea Mon Sep 17 00:00:00 2001 From: Alexey Havrilyuk Date: Wed, 30 Jul 2025 18:51:26 +0200 Subject: [PATCH 24/24] jreleaser plugin configs attempt --- .github/workflows/publishing2sonatype.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publishing2sonatype.yml b/.github/workflows/publishing2sonatype.yml index c5c58bd1..29d90515 100644 --- a/.github/workflows/publishing2sonatype.yml +++ b/.github/workflows/publishing2sonatype.yml @@ -36,6 +36,7 @@ jobs: sed -i -e 's|.*sonatypePassword.*| password = "${{ secrets.SPASSWORD }}"|' ./build.gradle - name: Sonatype Publish run: | + mkdir -p ~/.jreleaser touch ~/.jreleaser/config.toml echo "JRELEASER_NEXUS2_USERNAME='${{ secrets.SUSER }}'" >> ~/.jreleaser/config.toml echo "JRELEASER_NEXUS2_PASSWORD='${{ secrets.SPASSWORD }}'" >> ~/.jreleaser/config.toml