Extend GitVersion to Count Builds within a Version #4272
-
Description:Currently, GitVersion defaults to counting the number of commits since the last tag to generate the build number within a version. For our project, it would be helpful if GitVersion could alternatively count the number of builds within a version, independently of the number of commits. This would allow us to have consecutive build numbers for each new version without relying on commit count. Requirement:Implement an option in GitVersion that allows build numbering based on the count of builds within a specific version rather than on the number of commits since the last tag. Examples:At the moment when starting a version you start with zero commits (e.g. 1.2.0.0) after committing three times it will result with an inrease number of 3 when using the PreReleaseNumber Option (1.2.0.3). When having another 4 commits we have a count of 7. Benefits:
Acceptance Criteria:
Additional Information:If similar approaches or suggestions exist, it would be helpful to discuss them to find the best possible solution. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 12 replies
-
On https://semver.org/ following is written:
When triggering on commit twice the generated artefacts should be equivalent and have the same semantic version. We are generating this version based on the repository state. The only way I see is changing the workflow: GitFlow/v1
assembly-informational-format: '{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}' Link[1]: Version Variables |
Beta Was this translation helpful? Give feedback.
-
@HHobeck thank you very much for your guidance. It was manual deployment we have been looking for. So now we will modify the config and everything is working like we want it to work 🥳 |
Beta Was this translation helpful? Give feedback.
What do you mean with
CustomVersion
!? Do you have an example?Let's say you have the following git history:
with configuration A:
gitversion
would output1.0.1-next.1+2
: