Skip to content

Commit fae8883

Browse files
committed
1 parent 91822a8 commit fae8883

File tree

4 files changed

+32
-35
lines changed

4 files changed

+32
-35
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ tasks.register('release') {
5858

5959
nexusPublishing {
6060
repositories {
61-
sonatype
61+
sonatype()
6262
}
6363
}
6464

ci/release/Jenkinsfile

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ pipeline {
9393
stage('Release check') {
9494
steps {
9595
script {
96-
print "INFO: params.RELEASE_VERSION = ${params.RELEASE_VERSION}"
97-
print "INFO: params.DEVELOPMENT_VERSION = ${params.DEVELOPMENT_VERSION}"
98-
print "INFO: params.RELEASE_DRY_RUN? = ${params.RELEASE_DRY_RUN}"
96+
print "INFO: params.RELEASE_VERSION = ${params.RELEASE_VERSION}"
97+
print "INFO: params.DEVELOPMENT_VERSION = ${params.DEVELOPMENT_VERSION}"
98+
print "INFO: params.RELEASE_DRY_RUN? = ${params.RELEASE_DRY_RUN}"
9999

100100
checkoutReleaseScripts()
101101

@@ -112,7 +112,9 @@ pipeline {
112112
echo "Release was requested manually"
113113

114114
if ( !params.RELEASE_VERSION ) {
115-
throw new IllegalArgumentException( 'Missing value for parameter RELEASE_VERSION. This parameter must be set explicitly to prevent mistakes.' )
115+
throw new IllegalArgumentException(
116+
'Missing value for parameter RELEASE_VERSION. This parameter must be set explicitly to prevent mistakes.'
117+
)
116118
}
117119
releaseVersion = Version.parseReleaseVersion( params.RELEASE_VERSION )
118120

@@ -171,20 +173,20 @@ pipeline {
171173
configFile(fileId: 'release.config.ssh', targetLocation: "${env.HOME}/.ssh/config"),
172174
configFile(fileId: 'release.config.ssh.knownhosts', targetLocation: "${env.HOME}/.ssh/known_hosts")
173175
]) {
174-
sshagent(['ed25519.Hibernate-CI.github.com', 'hibernate.filemgmt.jboss.org', 'hibernate-ci.frs.sourceforge.net']) {
175-
// set release version
176-
// update changelog from JIRA
177-
// tags the version
178-
// changes the version to the provided development version
179-
withEnv([
180-
"BRANCH=${env.GIT_BRANCH}",
181-
"DISABLE_REMOTE_GRADLE_CACHE=true",
182-
// Increase the amount of memory for this part since asciidoctor doc rendering consumes a lot of metaspace
183-
"GRADLE_OPTS=-Dorg.gradle.jvmargs='-Dlog4j2.disableJmx -Xmx4g -XX:MaxMetaspaceSize=768m -XX:+HeapDumpOnOutOfMemoryError -Duser.language=en -Duser.country=US -Duser.timezone=UTC -Dfile.encoding=UTF-8'"
184-
]) {
185-
sh ".release/scripts/prepare-release.sh ${env.PROJECT} ${env.RELEASE_VERSION} ${env.DEVELOPMENT_VERSION}"
186-
}
187-
}
176+
sshagent(['ed25519.Hibernate-CI.github.com', 'hibernate.filemgmt.jboss.org', 'hibernate-ci.frs.sourceforge.net']) {
177+
// set release version
178+
// update changelog from JIRA
179+
// tags the version
180+
// changes the version to the provided development version
181+
withEnv([
182+
"BRANCH=${env.GIT_BRANCH}",
183+
"DISABLE_REMOTE_GRADLE_CACHE=true",
184+
// Increase the amount of memory for this part since asciidoctor doc rendering consumes a lot of metaspace
185+
"GRADLE_OPTS=-Dorg.gradle.jvmargs='-Dlog4j2.disableJmx -Xmx4g -XX:MaxMetaspaceSize=768m -XX:+HeapDumpOnOutOfMemoryError -Duser.language=en -Duser.country=US -Duser.timezone=UTC -Dfile.encoding=UTF-8'"
186+
]) {
187+
sh ".release/scripts/prepare-release.sh ${env.PROJECT} ${env.RELEASE_VERSION} ${env.DEVELOPMENT_VERSION}"
188+
}
189+
}
188190
}
189191
}
190192
}

ci/snapshot-publish.Jenkinsfile

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,19 @@ pipeline {
3030
}
3131
stage('Publish') {
3232
steps {
33-
withCredentials([
34-
usernamePassword(credentialsId: 'ossrh.sonatype.org', passwordVariable: 'OSSRH_PASSWORD', usernameVariable: 'OSSRH_USER'),
35-
usernamePassword(credentialsId: 'gradle-plugin-portal-api-key', passwordVariable: 'PLUGIN_PORTAL_PASSWORD', usernameVariable: 'PLUGIN_PORTAL_USERNAME'),
36-
file(credentialsId: 'release.gpg.private-key', variable: 'RELEASE_GPG_PRIVATE_KEY_PATH'),
37-
string(credentialsId: 'release.gpg.passphrase', variable: 'RELEASE_GPG_PASSPHRASE'),
38-
// https://github.com/gradle-nexus/publish-plugin#publishing-to-maven-central-via-sonatype-ossrh
39-
usernamePassword(credentialsId: 'ossrh.sonatype.org', passwordVariable: 'ORG_GRADLE_PROJECT_sonatypePassword', usernameVariable: 'ORG_GRADLE_PROJECT_sonatypeUsername'),
40-
// https://docs.gradle.org/current/userguide/publishing_gradle_plugins.html#account_setup
41-
usernamePassword(credentialsId: 'gradle-plugin-portal-api-key', passwordVariable: 'GRADLE_PUBLISH_SECRET', usernameVariable: 'GRADLE_PUBLISH_KEY'),
42-
file(credentialsId: 'release.gpg.private-key', variable: 'SIGNING_GPG_PRIVATE_KEY_PATH'),
43-
string(credentialsId: 'release.gpg.passphrase', variable: 'SIGNING_GPG_PASSPHRASE')
44-
]) {
33+
withCredentials([
34+
// https://github.com/gradle-nexus/publish-plugin#publishing-to-maven-central-via-sonatype-ossrh
35+
usernamePassword(credentialsId: 'ossrh.sonatype.org', passwordVariable: 'ORG_GRADLE_PROJECT_sonatypePassword', usernameVariable: 'ORG_GRADLE_PROJECT_sonatypeUsername'),
36+
// https://docs.gradle.org/current/userguide/publishing_gradle_plugins.html#account_setup
37+
usernamePassword(credentialsId: 'gradle-plugin-portal-api-key', passwordVariable: 'GRADLE_PUBLISH_SECRET', usernameVariable: 'GRADLE_PUBLISH_KEY'),
38+
file(credentialsId: 'release.gpg.private-key', variable: 'SIGNING_GPG_PRIVATE_KEY_PATH'),
39+
string(credentialsId: 'release.gpg.passphrase', variable: 'SIGNING_GPG_PASSPHRASE')
40+
gitUsernamePassword(credentialsId: 'username-and-token.Hibernate-CI.github.com', gitToolName: 'Default')
41+
]) {
4542
withEnv([
4643
"DISABLE_REMOTE_GRADLE_CACHE=true"
4744
]) {
48-
sh '''./gradlew clean publish -x test \
49-
--no-scan --no-daemon --no-build-cache --stacktrace
50-
'''
45+
sh './gradlew clean publish -x test --no-scan --no-daemon --no-build-cache --stacktrace'
5146
}
5247
}
5348
}

gradle/published-java-module.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ gradle.taskGraph.whenReady { TaskExecutionGraph graph ->
101101
else {
102102
// signing was not explicitly requested and we are not publishing to OSSRH,
103103
// - disable all Sign tasks
104-
tasks.withType( Sign ).each { enabled = false }
104+
tasks.withType( Sign ).each { t-> t.enabled = false }
105105
}
106106
}
107107

0 commit comments

Comments
 (0)