Extend GitVersion to Count Builds within a Version #4272
Replies: 1 comment 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.
-
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.
This option should only expose another variable with the build count so it can be used in the assemblyFileVersionFormat option.
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.
What our suggestion is: First Build 1.2.0.0, second build 1.2.0.1, third build 1.2.0.2, ...
So it is like adding another counter as Major, Minor, patch but with the name Revision or BuildCount maybe?
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.
All reactions