Skip to content

Commit 215ced6

Browse files
committed
Update the order of release steps and simplify the ORM build script [HHH-19913]
1 parent 5d482a2 commit 215ced6

File tree

10 files changed

+34
-423
lines changed

10 files changed

+34
-423
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: 12 additions & 14 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,7 +262,7 @@ 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' ) {
259267
// Lock to avoid rejected pushes when multiple releases try to clone-commit-push
260268
lock('hibernate.org-git') {
@@ -272,16 +280,6 @@ pipeline {
272280
}
273281
}
274282
}
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-
}
285283
}
286284
post {
287285
always {

documentation/documentation.gradle

Lines changed: 0 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

@@ -194,10 +193,6 @@ dependencies {
194193
if ( project.ormVersion.isSnapshot ) {
195194
// only run the ci build tasks for SNAPSHOT versions
196195
tasks.register('ciBuild') { dependsOn clean }
197-
tasks.release.enabled false
198-
}
199-
else {
200-
tasks.release.dependsOn clean
201196
}
202197

203198

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

@@ -102,12 +101,19 @@ task ciBuild {
102101
dependsOn test
103102
}
104103

105-
tasks.release.dependsOn tasks.test
106-
107-
tasks.preVerifyRelease.dependsOn build
108-
tasks.preVerifyRelease.dependsOn generateMetadataFileForPublishedArtifactsPublication
109-
tasks.preVerifyRelease.dependsOn generatePomFileForPublishedArtifactsPublication
110-
tasks.preVerifyRelease.dependsOn generatePomFileForRelocationPomPublication
104+
task releasePrepare {
105+
group 'Release'
106+
description 'Performs release preparations on local check-out, including updating changelog'
107+
108+
dependsOn build
109+
dependsOn generateMetadataFileForPublishedArtifactsPublication
110+
dependsOn generatePomFileForPublishedArtifactsPublication
111+
dependsOn generatePomFileForRelocationPomPublication
112+
dependsOn generatePomFileForRelocationPomPublication
113+
// we depend on publishAllPublicationsToStagingRepository to make sure that the artifacts are "published" to a local staging directory
114+
// used by JReleaser during the release process
115+
dependsOn publishAllPublicationsToStagingRepository
116+
}
111117

112118
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
113119
// 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

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 releasePrepare` 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)