Skip to content

Commit 2a1e6f9

Browse files
committed
Update the order of release steps and simplify the ORM build script [HHH-19913]
1 parent 3b75ff1 commit 2a1e6f9

21 files changed

+76
-1206
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 & 20 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', '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,31 +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-
checkout scmGit(
260-
branches: [[name: '*/production']],
261-
extensions: [],
262-
userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/hibernate/hibernate.org.git']]
263-
)
264-
sh "../scripts/website-release.sh ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.RELEASE_VERSION}"
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}"
265273
}
266274
}
267275
}
268276
}
269277
}
270278
}
271279
}
272-
stage('Create GitHub release') {
273-
steps {
274-
script {
275-
checkoutReleaseScripts()
276-
withCredentials([string(credentialsId: 'Hibernate-CI.github.com', variable: 'GITHUB_API_TOKEN')]) {
277-
sh ".release/scripts/github-release.sh ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.RELEASE_VERSION}"
278-
}
279-
}
280-
}
281-
}
282280
}
283281
post {
284282
always {

documentation/documentation.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,4 +840,12 @@ tasks.withType(AsciidoctorTask).configureEach {
840840
separateOutputDirs = false
841841
backends 'html5'
842842
}
843+
// See https://docs.asciidoctor.org/gradle-plugin/latest/common-task-configuration/#choosing-an-execution-mode-for-asciidoctorj
844+
executionMode = org.ysb33r.grolifant.api.core.jvm.ExecutionMode.JAVA_EXEC
843845
}
846+
847+
tasks.withType(AsciidoctorPdfTask).configureEach {
848+
// See https://docs.asciidoctor.org/gradle-plugin/latest/common-task-configuration/#choosing-an-execution-mode-for-asciidoctorj
849+
executionMode = org.ysb33r.grolifant.api.core.jvm.ExecutionMode.JAVA_EXEC
850+
}
851+

gradle/published-java-module.gradle

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ apply from: rootProject.file( 'gradle/releasable.gradle' )
99
apply from: rootProject.file( 'gradle/java-module.gradle' )
1010
apply from: rootProject.file( 'gradle/publishing-pom.gradle' )
1111

12-
// Make sure that the publishReleaseArtifacts task of the release module runs the release task of this sub module
13-
tasks.getByPath( ':release:publishReleaseArtifacts' ).dependsOn tasks.release
14-
1512
configurations {
1613
javadocSources {
1714
description 'Used to aggregate javadocs for the whole project'
@@ -129,10 +126,19 @@ tasks.register('ciBuild') {
129126

130127
tasks.release.dependsOn tasks.test
131128

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

137143
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
138144
// Ancillary tasks

gradle/publishing-pom.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,4 @@ publishing {
7474
}
7575

7676
}
77+

gradle/releasable.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ task release {
55
enabled !project.ormVersion.isSnapshot
66
}
77

8-
task preVerifyRelease {
9-
dependsOn ':release:preVerifyRelease'
8+
task prepareRelease {
9+
dependsOn ':release:prepareRelease'
1010
}

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'

local-build-plugins/src/main/java/org/hibernate/orm/docs/DescriptorAccess.java

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

local-build-plugins/src/main/java/org/hibernate/orm/docs/DocumentationPublishing.java

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

0 commit comments

Comments
 (0)