Skip to content

Commit

Permalink
#806 | project.version set when updateProjectVersionAfterRelease flag…
Browse files Browse the repository at this point in the history
… is enabled
  • Loading branch information
bgalek committed Sep 2, 2024
1 parent 4d80f09 commit c8ddf6b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ abstract class ReleasePlugin implements Plugin<Project> {
description = 'Performs release - creates tag and pushes it to remote.'
dependsOn(VERIFY_RELEASE_TASK)
if (versionConfig.updateProjectVersionAfterRelease.get()) {
println("Project version will be updated after release.")
project.logger.quiet("Project version will be updated after release.")
finalizedBy(project.tasks.assemble)
} else {
println("Project version will not be updated after release.")
}
}

Expand All @@ -54,10 +52,8 @@ abstract class ReleasePlugin implements Plugin<Project> {
description = 'Performs first stage of release - creates tag.'
dependsOn(VERIFY_RELEASE_TASK)
if (versionConfig.updateProjectVersionAfterRelease.get()) {
println("Project version will be updated after release.")
project.logger.quiet("Project version will be updated after release.")
finalizedBy(project.tasks.assemble)
} else {
println("Project version will not be updated after release.")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ abstract class ReleaseTask extends BaseAxionTask {
throw new ReleaseFailedException("Status: ${status}\nMessage: ${message}")
}

if (result.outcome === ScmPushResultOutcome.SUCCESS) {
if (versionConfig.updateProjectVersionAfterRelease().get()) {
project.version = versionConfig.uncached.decoratedVersion
}

if (result.outcome === ScmPushResultOutcome.SUCCESS) {
if (System.getenv().containsKey('GITHUB_ACTIONS')) {
Files.write(
Paths.get(System.getenv('GITHUB_OUTPUT')),
Expand Down

0 comments on commit c8ddf6b

Please sign in to comment.