Skip to content

Commit e359da1

Browse files
committed
Update the order of release steps and simplify the ORM build script [HHH-19913]
1 parent 40386ac commit e359da1

File tree

10 files changed

+45
-461
lines changed

10 files changed

+45
-461
lines changed

build.gradle

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,6 @@ apply from: file( 'gradle/module.gradle' )
4040
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4141
// Release Task
4242

43-
tasks.register('release') {
44-
description = "The task performed when we are performing a release build. Relies on " +
45-
"the fact that subprojects will appropriately define a release task " +
46-
"themselves if they have any release-related activities to perform"
47-
48-
doFirst {
49-
def javaVersionsInUse = jdkVersions.allVersions
50-
if (javaVersionsInUse != [JavaLanguageVersion.of(11)].toSet()) {
51-
throw new IllegalStateException("Please use JDK 11 to perform the release. Currently using: ${javaVersionsInUse}")
52-
}
53-
}
54-
}
55-
5643
tasks.register('publish') {
5744
description = "The task performed when we want to just publish maven artifacts. Relies on " +
5845
"the fact that subprojects will appropriately define a release task " +

ci/release/Jenkinsfile

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ pipeline {
182182
configFile(fileId: 'release.config.ssh', targetLocation: "${env.HOME}/.ssh/config"),
183183
configFile(fileId: 'release.config.ssh.knownhosts', targetLocation: "${env.HOME}/.ssh/known_hosts")
184184
]) {
185-
sshagent(['ed25519.Hibernate-CI.github.com', 'hibernate.filemgmt.jboss.org', 'hibernate-ci.frs.sourceforge.net']) {
185+
sshagent(['ed25519.Hibernate-CI.github.com', 'hibernate-ci.frs.sourceforge.net']) {
186186
// set release version
187187
// update changelog from JIRA
188188
// tags the version
@@ -217,13 +217,21 @@ pipeline {
217217
string(credentialsId: 'release.gpg.passphrase', variable: 'JRELEASER_GPG_PASSPHRASE'),
218218
string(credentialsId: 'Hibernate-CI.github.com', variable: 'JRELEASER_GITHUB_TOKEN')
219219
]) {
220-
sshagent(['ed25519.Hibernate-CI.github.com', 'hibernate.filemgmt.jboss.org', 'jenkins.in.relation.to', 'hibernate-ci.frs.sourceforge.net']) {
220+
sshagent(['ed25519.Hibernate-CI.github.com', 'jenkins.in.relation.to', 'hibernate-ci.frs.sourceforge.net']) {
221221
// performs documentation upload and Sonatype release
222222
// push to github
223223
withEnv([
224224
"DISABLE_REMOTE_GRADLE_CACHE=true"
225225
]) {
226-
sh ".release/scripts/publish.sh -j ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.RELEASE_VERSION} ${env.DEVELOPMENT_VERSION} ${env.GIT_BRANCH}"
226+
def notesFiles = findFiles(glob: 'release_notes.md')
227+
if ( notesFiles.length < 1 ) {
228+
throw new IllegalStateException( "Could not locate `release_notes.md`" )
229+
}
230+
if ( notesFiles.length > 1 ) {
231+
throw new IllegalStateException( "Located more than 1 `release_notes.md`" )
232+
}
233+
234+
sh ".release/scripts/publish.sh -j --notes=${notesFiles[0].path} ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.RELEASE_VERSION} ${env.DEVELOPMENT_VERSION} ${env.GIT_BRANCH} "
227235
}
228236
}
229237
}
@@ -254,34 +262,21 @@ pipeline {
254262
withCredentials([
255263
gitUsernamePassword(credentialsId: 'username-and-token.Hibernate-CI.github.com', gitToolName: 'Default')
256264
]) {
257-
sshagent( ['ed25519.Hibernate-CI.github.com', 'hibernate.filemgmt.jboss.org', 'hibernate-ci.frs.sourceforge.net'] ) {
265+
sshagent( ['ed25519.Hibernate-CI.github.com'] ) {
258266
dir( '.release/hibernate.org' ) {
259-
// Lock to avoid rejected pushes when multiple releases try to clone-commit-push
260-
lock('hibernate.org-git') {
261-
checkout scmGit(
262-
branches: [[name: '*/production']],
263-
extensions: [],
264-
userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/hibernate/hibernate.org.git']]
265-
)
266-
sh "../scripts/website-release.sh ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.RELEASE_VERSION}"
267-
}
267+
checkout scmGit(
268+
branches: [[name: '*/production']],
269+
extensions: [],
270+
userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/hibernate/hibernate.org.git']]
271+
)
272+
sh "../scripts/website-release.sh ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.RELEASE_VERSION}"
268273
}
269274
}
270275
}
271276
}
272277
}
273278
}
274279
}
275-
stage('Create GitHub release') {
276-
steps {
277-
script {
278-
checkoutReleaseScripts()
279-
withCredentials([string(credentialsId: 'Hibernate-CI.github.com', variable: 'GITHUB_API_TOKEN')]) {
280-
sh ".release/scripts/github-release.sh ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.RELEASE_VERSION}"
281-
}
282-
}
283-
}
284-
}
285280
}
286281
post {
287282
always {

documentation/documentation.gradle

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ repositories {
3434

3535

3636
apply from: rootProject.file( 'gradle/module.gradle' )
37-
apply from: rootProject.file( 'gradle/releasable.gradle' )
3837

3938
apply plugin: 'org.hibernate.orm.build.reports'
4039

@@ -192,10 +191,6 @@ dependencies {
192191
if ( project.ormVersion.isSnapshot ) {
193192
// only run the ci build tasks for SNAPSHOT versions
194193
tasks.register('ciBuild') { dependsOn clean }
195-
tasks.release.enabled false
196-
}
197-
else {
198-
tasks.release.dependsOn clean
199194
}
200195

201196

@@ -797,4 +792,12 @@ tasks.withType(AsciidoctorTask).configureEach {
797792
separateOutputDirs = false
798793
backends 'html5'
799794
}
795+
// See https://docs.asciidoctor.org/gradle-plugin/latest/common-task-configuration/#choosing-an-execution-mode-for-asciidoctorj
796+
executionMode = org.ysb33r.grolifant.api.core.jvm.ExecutionMode.JAVA_EXEC
797+
}
798+
799+
tasks.withType(AsciidoctorPdfTask).configureEach {
800+
// See https://docs.asciidoctor.org/gradle-plugin/latest/common-task-configuration/#choosing-an-execution-mode-for-asciidoctorj
801+
executionMode = org.ysb33r.grolifant.api.core.jvm.ExecutionMode.JAVA_EXEC
800802
}
803+

gradle/published-java-module.gradle

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
66
*/
77

8-
apply from: rootProject.file( 'gradle/releasable.gradle' )
98
apply from: rootProject.file( 'gradle/java-module.gradle' )
109
apply from: rootProject.file( 'gradle/publishing-pom.gradle' )
1110

@@ -123,12 +122,19 @@ tasks.register('ciBuild') {
123122
dependsOn test
124123
}
125124

126-
tasks.release.dependsOn tasks.test
127-
128-
tasks.preVerifyRelease.dependsOn build
129-
tasks.preVerifyRelease.dependsOn generateMetadataFileForPublishedArtifactsPublication
130-
tasks.preVerifyRelease.dependsOn generatePomFileForPublishedArtifactsPublication
131-
tasks.preVerifyRelease.dependsOn generatePomFileForRelocationPomPublication
125+
task releasePrepare {
126+
group 'Release'
127+
description 'Performs release preparations on local check-out, including updating changelog'
128+
129+
dependsOn build
130+
dependsOn generateMetadataFileForPublishedArtifactsPublication
131+
dependsOn generatePomFileForPublishedArtifactsPublication
132+
dependsOn generatePomFileForRelocationPomPublication
133+
dependsOn generatePomFileForRelocationPomPublication
134+
// we depend on publishAllPublicationsToStagingRepository to make sure that the artifacts are "published" to a local staging directory
135+
// used by JReleaser during the release process
136+
dependsOn publishAllPublicationsToStagingRepository
137+
}
132138

133139
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
134140
// Ancillary tasks

gradle/releasable.gradle

Lines changed: 0 additions & 10 deletions
This file was deleted.

hibernate-platform/hibernate-platform.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ plugins {
44

55
description = 'Gradle platform for Hibernate ORM'
66

7-
apply from: rootProject.file( 'gradle/releasable.gradle' )
87
apply from: rootProject.file( "gradle/base-information.gradle" )
98
apply from: rootProject.file( "gradle/publishing-pom.gradle" )
109

local-build-plugins/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ gradlePlugin {
5252
id = 'org.hibernate.orm.build.reports'
5353
implementationClass = 'org.hibernate.orm.post.ReportGenerationPlugin'
5454
}
55-
docPubPlugin {
56-
id = 'org.hibernate.orm.build.doc-pub'
57-
implementationClass = 'org.hibernate.orm.docs.DocumentationPublishingPlugin'
58-
}
5955
envSettings {
6056
id = 'org.hibernate.orm.build.env-settings'
6157
implementationClass = 'org.hibernate.orm.env.EnvironmentSettingsPlugin'

release/jenkins-release-process.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ First, a list of resources you will need access to in order to perform a release
1515

1616
== Steps
1717

18-
1. Perform `./gradlew preVerifyRelease` locally (after pulling all upstream changes). The Jenkins job does only the release steps, and we need to make sure tests and checkstyle especially are ok
18+
1. Perform `./gradlew prepareRelease` locally (after pulling all upstream changes). The Jenkins job does only the release steps, and we need to make sure tests and checkstyle especially are ok
1919
2. Mark the version as released in Jira
2020
3. Close all issues associated with the version as closed. Be sure to remove the version from any issues that are not resolved (e.g. rejected) - the Jira "release notes" mechanism includes all issues with that version as the fix-for regardless of the resolution
2121
4. Start the https://ci.hibernate.org/view/ORM/job/hibernate-orm-release/[Jenkins job]. It is a parameterized build - Jenkins will prompt user for needed information:
@@ -34,4 +34,4 @@ The Jenkins job performs the following tasks:
3434

3535
== Post-release steps
3636

37-
See <<./post-release-steps.adoc>>
37+
See <<./post-release-steps.adoc>>

0 commit comments

Comments
 (0)