You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we set the mod version in gradle.properties and bump this value before doing a new release.
It may be useful to generate it instead, potentially reducing release friction and opening the door to "snapshot" builds, etc.
This may not be something you actually want; manually defining the version inherently comes with more control and less complexity. Feel free to label this issue wontfix.
Implementation
The algorithm would be something along the lines of:
Get some data from git;
Most recent ancestor tag (filtered by regex)
Number of commits since tag
Current branch name
Is the working directory clean or dirty
If 0 commits since tag, and the dir is clean, this is a release version
Handle if the commit has multiple tags; try to find the "version" tag
Set project.version to the tag
Otherwise, this is a "snapshot" build
Maybe do something like latest_tag+commit_count+dirty?
Complications
Simply implementing the above would kinda break patchChangelog, since it uses mod_version to determine what version to mark the "unreleased" changes as belonging to. Therefore we couldn't patch the changelog until after tagging the release commit, meaning we'd have to --amend it.
Probably the best way to avoid this would be three separate gradle tasks:
bumpMajorVersion: ++x.0.0
bumpMinorVersion: x.++y.0
bumpPatchVersion: x.y.++z
Running any of these tasks would detect the previous release, bump project.version, patch the changelog, commit & tag.
The release process would then become:
Run gradlew bumpPatchVersion
Run git push to push the new commit to the remote branch
Run git push --tags or git push origin <tagname> to push the tags
These bumping tasks could still be added even without dynamic versions, but I'm mentioning them here as they solve the changlog patching issue.
The text was updated successfully, but these errors were encountered:
Currently we set the mod version in
gradle.properties
and bump this value before doing a new release.It may be useful to generate it instead, potentially reducing release friction and opening the door to "snapshot" builds, etc.
This may not be something you actually want; manually defining the version inherently comes with more control and less complexity. Feel free to label this issue
wontfix
.Implementation
The algorithm would be something along the lines of:
project.version
to the taglatest_tag+commit_count+dirty
?Complications
Simply implementing the above would kinda break
patchChangelog
, since it usesmod_version
to determine what version to mark the "unreleased" changes as belonging to. Therefore we couldn't patch the changelog until after tagging the release commit, meaning we'd have to--amend
it.Probably the best way to avoid this would be three separate gradle tasks:
bumpMajorVersion
:++x.0.0
bumpMinorVersion
:x.++y.0
bumpPatchVersion
:x.y.++z
Running any of these tasks would detect the previous release, bump
project.version
, patch the changelog, commit & tag.The release process would then become:
gradlew bumpPatchVersion
git push
to push the new commit to the remote branchgit push --tags
orgit push origin <tagname>
to push the tagsThese bumping tasks could still be added even without dynamic versions, but I'm mentioning them here as they solve the changlog patching issue.
The text was updated successfully, but these errors were encountered: