gradle-release
gradle-release copied to clipboard
Additional hook between createReleaseTag and updateVersion
If you want to automatically create a GitHub release (in non-draft state), the tag needs to be created and pushed already, or GitHub will tag the current state of the branch automatically which is not what you want.
To do this, you must do the GitHub release creation after the createReleaseTag
task was executed (so that the tag is present on GitHub), but before the updateVersion
task was executed (or the project.version
is not the released one anymore and you cannot use the tag name calculation properly.
Also for this maybe the preTagCommit
and createReleaseTag
tasks should be moved into the inner-most GradleBuild call, so that the project version can properly be used without the need for taking precaution to not evaluate it too early.
Can't we use the afterReleaseBuild task for this? It is called before the snapshot is added and is executed when the project has the release version.
Nope, the point is, that the tag must be present on GitHub, which it is not, it is not even created.
Ah ok got it :)