HHH-17239 Automate maintenance releases

This commit is contained in:
Christian Beikov 2023-10-04 23:02:22 +02:00
parent e439b90f8e
commit 626b3a950a
2 changed files with 32 additions and 23 deletions

View File

@ -33,6 +33,7 @@ plugins {
id 'idea'
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.0'
id 'eclipse'
id "com.dorongold.task-tree" version "2.1.1"
}
apply from: file( 'gradle/module.gradle' )

View File

@ -318,7 +318,7 @@ def changeToDevelopmentVersionTask = tasks.register( 'changeToDevelopmentVersion
}
}
def gitTasksAfterReleaseTask = tasks.register( 'gitTasksAfterRelease' ) {
def releasePreparePostGitTask = tasks.register( 'gitTasksAfterRelease' ) {
dependsOn changeToDevelopmentVersionTask
doLast {
@ -345,22 +345,7 @@ def publishReleaseArtifactsTask = tasks.register( 'publishReleaseArtifacts' ) {
dependsOn uploadDocumentationDescriptor
}
def releaseTask = tasks.register( 'release' ) {
group 'Release'
description 'Performs a release on local check-out, including updating changelog and '
dependsOn gitPreparationForReleaseTask
dependsOn publishReleaseArtifactsTask
finalizedBy gitTasksAfterReleaseTask
}
def ciReleaseChecksTask = tasks.register( 'ciReleaseChecks' ) {
}
def gitTasksAfterCiReleaseTask = tasks.register( 'gitTasksAfterCiRelease' ) {
dependsOn gitTasksAfterReleaseTask
def releasePerformPostGitTask = tasks.register( 'gitTasksAfterReleasePerform' ) {
doLast {
if ( project.createTag ) {
@ -374,14 +359,37 @@ def gitTasksAfterCiReleaseTask = tasks.register( 'gitTasksAfterCiRelease' ) {
}
}
def releasePrepareTask = tasks.register( 'releasePrepare' ) {
group 'Release'
description 'Performs release preparations on local check-out, including updating changelog'
dependsOn gitPreparationForReleaseTask
finalizedBy releasePreparePostGitTask
}
def releasePerformTask = tasks.register( 'releasePerform' ) {
group 'Release'
description 'Performs a release on local check-out, including updating changelog and '
dependsOn publishReleaseArtifactsTask
finalizedBy releasePerformPostGitTask
}
def releaseTask = tasks.register( 'release' ) {
group 'Release'
description 'Performs a release on local check-out, including updating changelog and '
dependsOn releasePrepareTask
dependsOn releasePerformTask
}
def ciReleaseTask = tasks.register( 'ciRelease' ) {
group 'Release'
description 'Performs a release: the hibernate version is set and the changelog.txt file updated, the changes are pushed to github, then the release is performed, tagged and the hibernate version is set to the development one.'
dependsOn ciReleaseChecksTask
dependsOn releaseTask
finalizedBy gitTasksAfterCiReleaseTask
}
static String executeGitCommand(Object ... subcommand){
@ -512,9 +520,9 @@ gradle.getTaskGraph().whenReady {tg->
String releaseVersionLocal
String developmentVersionLocal
def console = tg.hasTask( project.tasks.ciReleaseChecks )
? null
: System.console()
def console = tg.hasTask( project.tasks.release ) && !tg.hasTask( project.tasks.ciRelease )
? System.console()
: null
if (project.hasProperty('releaseVersion')) {
releaseVersionLocal = project.property('releaseVersion')