HHH-17239 Automate maintenance releases

This commit is contained in:
Christian Beikov 2023-10-04 21:28:08 +02:00
parent cc3dd1204f
commit e439b90f8e
2 changed files with 3 additions and 4 deletions

View File

@ -1,7 +1,6 @@
apply from: rootProject.file( 'gradle/base-information.gradle' ) apply from: rootProject.file( 'gradle/base-information.gradle' )
task release { task release {
dependsOn ':release:releaseChecks'
mustRunAfter ':release:releaseChecks' mustRunAfter ':release:releaseChecks'
enabled !project.ormVersion.isSnapshot enabled !project.ormVersion.isSnapshot
} }

View File

@ -229,14 +229,14 @@ def releaseChecksTask = tasks.register( "releaseChecks" ) {
gitBranchLocal = project.property('gitBranch') gitBranchLocal = project.property('gitBranch')
} }
else { else {
gitBranchLocal = executeGitCommand( 'branch', '--show-current' ) gitBranchLocal = executeGitCommand( 'branch', '--show-current' ).trim()
} }
if (project.hasProperty('gitRemote')) { if (project.hasProperty('gitRemote')) {
gitRemoteLocal = project.property('gitRemote') gitRemoteLocal = project.property('gitRemote')
} }
else { else {
final String remotes = executeGitCommand( 'remote', 'show' ) final String remotes = executeGitCommand( 'remote', 'show' ).trim()
final List<String> tokens = remotes.tokenize() final List<String> tokens = remotes.tokenize()
if ( tokens.size() != 1 ) { if ( tokens.size() != 1 ) {
throw new GradleException( "Could not determine `gitRemote` property for `releaseChecks` tasks." ) throw new GradleException( "Could not determine `gitRemote` property for `releaseChecks` tasks." )
@ -263,7 +263,7 @@ def releaseChecksTask = tasks.register( "releaseChecks" ) {
} }
} }
def preVerifyReleaseTask = tasks.register( "preVerifyRelease" ){ def preVerifyReleaseTask = tasks.register( "preVerifyRelease" ) {
group 'Release' group 'Release'
description 'Pre-verifies a release job execution (Run locally before a CI release)' description 'Pre-verifies a release job execution (Run locally before a CI release)'