From c4c6f8354b55b5913387589d897deb18a975a1fe Mon Sep 17 00:00:00 2001 From: Alec Grieser Date: Tue, 4 Nov 2025 17:49:10 +0000 Subject: [PATCH 1/3] Revert "Increase heap size for JReleaser (#3720)" This reverts commit 729f2eb3508cab39ba0132ae691cc256b17f37ee. --- .github/workflows/release.yml | 4 +--- actions/run-gradle/action.yml | 2 +- gradle.properties | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e12d817196..1554e12a85 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -198,9 +198,7 @@ jobs: uses: actions/upload-artifact@v4.6.0 with: name: jrelease-trace - path: | - .out/jreleaser/* - ! .out/jreleaser/deploy/* + path: .out/jreleaser/* retention-days: 1 # Post release: Update various files which reference version diff --git a/actions/run-gradle/action.yml b/actions/run-gradle/action.yml index d5a3d49194..22aaed12fb 100644 --- a/actions/run-gradle/action.yml +++ b/actions/run-gradle/action.yml @@ -13,4 +13,4 @@ runs: run: sed -i -e "s/^org\.gradle\..*/#&/g" gradle.properties - name: Run Command shell: bash - run: GRADLE_OPTS="-XX:+HeapDumpOnOutOfMemoryError -XX:+TieredCompilation -Xmx8192m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED" ./gradlew --no-daemon --console=plain --warning-mode all ${{ inputs.gradle_command }} + run: GRADLE_OPTS="-XX:+HeapDumpOnOutOfMemoryError -XX:+TieredCompilation -Xmx4096m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED" ./gradlew --no-daemon --console=plain --warning-mode all ${{ inputs.gradle_command }} diff --git a/gradle.properties b/gradle.properties index 0ee4f96609..fb0b9772e4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,7 +27,7 @@ allowSnapshots=true group=org.foundationdb -org.gradle.jvmargs=-Xmx8192m -XX:+HeapDumpOnOutOfMemoryError -Xverify:none -XX:+TieredCompilation +org.gradle.jvmargs=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -Xverify:none -XX:+TieredCompilation # Set the api version used by build and CI tests. The default api version used by consumers is not impacted and is determined # by ApiVersion.getDefault() From ca322e39afd214db4233c8ed04e3b4cb910b41e2 Mon Sep 17 00:00:00 2001 From: Alec Grieser Date: Tue, 4 Nov 2025 17:49:31 +0000 Subject: [PATCH 2/3] Revert "Upload the jreleaser trace logs & config (#3718)" This reverts commit fd79e736dcb4623b40ac16b98eca605bc2e77155. --- .github/workflows/release.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1554e12a85..6ae1a26525 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -193,13 +193,6 @@ jobs: JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.SONATYPE_USERNAME }} JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload jreleaser trace logs - if: always() - uses: actions/upload-artifact@v4.6.0 - with: - name: jrelease-trace - path: .out/jreleaser/* - retention-days: 1 # Post release: Update various files which reference version # Updating the yaml files has to be done after the tests complete, or it will mark tests as failing that aren't From 36b94d7fca9a0927b00e34cae6edb1de0ade3476 Mon Sep 17 00:00:00 2001 From: Alec Grieser Date: Tue, 4 Nov 2025 17:50:13 +0000 Subject: [PATCH 3/3] Revert "Update the release plugin to use the central publishing API directly (#3710)" This reverts commit b1dac6784b9488ad08dcc73953603917ec36b080. --- .github/workflows/release.yml | 11 ++-- build.gradle | 59 ++++++------------- .../fdb-record-layer-core-shaded.gradle | 6 ++ gradle/libs.versions.toml | 2 +- gradle/publishing.gradle | 21 +++---- 5 files changed, 38 insertions(+), 61 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6ae1a26525..b6de4deefe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -185,13 +185,12 @@ jobs: - name: Publish Artifacts uses: ./actions/run-gradle with: - gradle_command: publish jreleaserDeploy -PreleaseBuild=true -PpublishBuild=true -PgithubPublish=true -PcentralPublish=true + gradle_command: publish closeAndReleaseStagingRepositories -PreleaseBuild=true -PpublishBuild=true -PgithubPublish=true -PcentralPublish=true env: - JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }} - JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.SONATYPE_USERNAME }} - JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }} + ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }} + ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} + ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Post release: Update various files which reference version diff --git a/build.gradle b/build.gradle index b082d0999d..d4dc5c72ea 100644 --- a/build.gradle +++ b/build.gradle @@ -18,9 +18,10 @@ * limitations under the License. */ -import org.apache.tools.ant.taskdefs.condition.Os import org.yaml.snakeyaml.Yaml +import org.apache.tools.ant.taskdefs.condition.Os + buildscript { repositories { if (Boolean.parseBoolean(mavenLocalEnabled)) { @@ -40,7 +41,7 @@ plugins { alias(libs.plugins.protobuf) alias(libs.plugins.versions) alias(libs.plugins.spotbugs) - alias(libs.plugins.jreleaser) + alias(libs.plugins.nexus) alias(libs.plugins.download) } @@ -59,6 +60,7 @@ allprojects { apply plugin: 'base' apply plugin: 'java-library' apply plugin: 'maven-publish' + apply plugin: 'signing' apply plugin: 'project-reports' apply plugin: 'com.github.ben-manes.versions' apply plugin: 'de.undercouch.download' @@ -163,6 +165,14 @@ allprojects { dependsOn tasks.jar, tasks.package } + signing { + def signingKey = findProperty("signingKey") + def signingPassword = findProperty("signingPassword") + if (signingKey != null && signingPassword != null) { + useInMemoryPgpKeys(signingKey, signingPassword) + } + } + repositories { if (System.getenv("ARTIFACT_VERSION") != null) { version = "${System.getenv('ARTIFACT_VERSION')}" @@ -300,47 +310,16 @@ subprojects { // Configure publishing for maven central. This is done in the top-level build.gradle, and then // all of the subprojects configure the artifacts they want published by applying // ${rootDir}/gradle/publishing.gradle in the project gradle. By default, we publish a library -// from each package, but this can be configured by adjusting the publishLibrary variable. -// Each subproject will place its artifacts into the central staging repository, -// which will then be picked up by the release configuration -if (Boolean.parseBoolean(publishBuild) && Boolean.parseBoolean(centralPublish)) { - var stagingRepo = layout.buildDirectory.dir('staging-repo') - - jreleaser { - project { - authors = ['FoundationDB'] - license = 'The Apache License, Version 2.0' - licenseUrl = 'https://www.apache.org/licenses/LICENSE-2.0' - links { - homepage = 'https://foundationdb.github.io/fdb-record-layer/' - } - inceptionYear = '2015' - } - - signing { - active = 'ALWAYS' - armored = true - } - - deploy { - maven { - mavenCentral { - sonatype { - active = 'ALWAYS' - url = 'https://central.sonatype.com/api/v1/publisher' - applyMavenCentralRules = true - stage = 'FULL' - - stagingRepository(stagingRepo.get().asFile.path) - } - } +// from each package, but this can be configured by adjusting the publishLibrary variable +if (Boolean.parseBoolean(centralPublish)) { + nexusPublishing { + repositories { + sonatype { + // Update the URL now that the OSSRH service has been sunset: https://central.sonatype.org/news/20250326_ossrh_sunset/ + nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) } } - - dependsOnAssemble = true } - - tasks.jreleaserDeploy.inputs.dir(stagingRepo) } // Script for upgrading gradle. To upgrade the gradle version, set the property to the version diff --git a/fdb-record-layer-core-shaded/fdb-record-layer-core-shaded.gradle b/fdb-record-layer-core-shaded/fdb-record-layer-core-shaded.gradle index c0d3837c0a..c3f46d943c 100644 --- a/fdb-record-layer-core-shaded/fdb-record-layer-core-shaded.gradle +++ b/fdb-record-layer-core-shaded/fdb-record-layer-core-shaded.gradle @@ -120,3 +120,9 @@ publishing { } } + +if (Boolean.parseBoolean(centralPublish)) { + signing { + sign publishing.publications.shadow + } +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6bc4859419..c4e6482b97 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -153,7 +153,7 @@ test-compileOnly = [ "autoService", "jsr305" ] download = { id = "de.undercouch.download", version = "5.6.0" } gitversion = { id = "com.palantir.git-version", version = "3.1.0" } jmh = { id = "me.champeau.jmh", version = "0.7.2" } -jreleaser = { id = "org.jreleaser", version = "1.21.0" } +nexus = { id = "io.github.gradle-nexus.publish-plugin", version = "2.0.0" } protobuf = { id = "com.google.protobuf", version = "0.9.4" } serviceloader = { id = "com.github.harbby.gradle.serviceloader", version = "1.1.8" } shadow = { id = "com.gradleup.shadow", version = "8.3.5" } diff --git a/gradle/publishing.gradle b/gradle/publishing.gradle index 6bb05393a6..79e4d82ef9 100644 --- a/gradle/publishing.gradle +++ b/gradle/publishing.gradle @@ -18,6 +18,8 @@ * limitations under the License. */ +apply plugin: 'signing' + // Add various details to the pom file to allow for publishing def addPublishingInfo(publication) { publication.pom { @@ -86,6 +88,11 @@ if (ext.publishLibrary) { } } } + if (Boolean.parseBoolean(centralPublish)) { + signing { + sign publishing.publications.library + } + } } ext { @@ -95,21 +102,7 @@ ext { publishing { if (Boolean.parseBoolean(publishBuild)) { - repositories { - if (Boolean.parseBoolean(centralPublish)) { - // For JReleaser to deploy artifacts, they must have been staged to the local staging repo. - // Mark that directory as an output and declare a dependency between publishing the - // project and deploying artifacts. - var stagingDir = rootProject.layout.buildDirectory.dir('staging-repo') - tasks.publish.outputs.dir(stagingDir) - rootProject.tasks.findByName('jreleaserDeploy').dependsOn(tasks.publish) - - maven { - url = stagingDir - } - } - if (Boolean.parseBoolean(githubPublish)) { maven { name = "GitHubPackages"