Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,23 +185,13 @@ 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 }}
- name: Upload jreleaser trace logs
if: always()
uses: actions/upload-artifact@v4.6.0
with:
name: jrelease-trace
path: |
.out/jreleaser/*
! .out/jreleaser/deploy/*
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
Expand Down
2 changes: 1 addition & 1 deletion actions/run-gradle/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
59 changes: 19 additions & 40 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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)
}

Expand All @@ -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'
Expand Down Expand Up @@ -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')}"
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,9 @@ publishing {

}
}

if (Boolean.parseBoolean(centralPublish)) {
signing {
sign publishing.publications.shadow
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
21 changes: 7 additions & 14 deletions gradle/publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -86,6 +88,11 @@ if (ext.publishLibrary) {
}
}
}
if (Boolean.parseBoolean(centralPublish)) {
signing {
sign publishing.publications.library
}
}
}

ext {
Expand All @@ -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"
Expand Down
Loading