-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathGitVersion.yml
More file actions
79 lines (76 loc) · 2.97 KB
/
GitVersion.yml
File metadata and controls
79 lines (76 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Each merged branch against main will increment the version unless otherwise specified in a commit message
# TrunkBased is the only workflow where each commit to a feature changes the pre-release tag
workflow: GitHubFlow/v1
# No pre-release versions from mainline
mode: ContinuousDeployment
# No dashes in date
commit-date-format: "yyyyMMddTHHmmss"
# Use BUILD_COUNT environment variable with fallback of zero
assembly-versioning-format: '{Major}.{Minor}.{Patch}.{env:BUILD_COUNT ?? 0}'
# NOTE: Normally I prefer:
# '{Major}.{Minor}.{Patch}{PreReleaseTagWithDash}+Build.{env:BUILD_COUNT ?? 0}.Date.{CommitDate}.Branch.{BranchName ?? unknown}.Sha.{Sha}'
assembly-informational-format: '{Major}.{Minor}.{Patch}{PreReleaseTagWithDash}+Build.{env:BUILD_COUNT ?? 0}.Branch.{BranchName ?? unknown}.Sha.{ShortSha}'
# Version bump messages in git trailers format
major-version-bump-message: 'semver:\s?(breaking|major)'
minor-version-bump-message: 'semver:\s?(feature|minor)'
patch-version-bump-message: 'semver:\s?(fix|patch)'
no-bump-message: 'semver:\s?(none|skip)'
commit-message-incrementing: Enabled
# semantic-version-format: Loose
strategies:
- Mainline
- TaggedCommit
- VersionInBranchName
- TrackReleaseBranches
- MergeMessage
branches:
main:
# tracks-release-branches: true
increment: Patch
prevent-increment:
# If false, rebuilds of the same code will increment the version!
when-current-commit-tagged: true
release:
mode: ContinuousDelivery
label: rc
increment: None
prevent-increment:
of-merged-branch: true
when-current-commit-tagged: false
track-merge-target: false
is-release-branch: true
# A hotfix is just a release with bad habits
regex: ^(?:releases?)/(?<BranchName>\d+\.\d+(\.\d+)?)$
hotfix:
mode: ContinuousDelivery
label: rc
regex: ^(?:hotfix(?:es)?)/(?<BranchName>\d+\.\d+(\.\d+)?)$
increment: None
prevent-increment:
of-merged-branch: true
when-current-commit-tagged: false
track-merge-target: false
is-release-branch: true
feature:
mode: ContinuousDelivery
# any branch name that starts with feature
# (with any number of / separated segments)
# we use the last segment as the BranchName label...
regex: ^features?[/-](.+[/-])*(?<BranchName>[^/-]+)$
# label: alpha.{BranchName}.
# Since we *know* it's a feature, then we can increment the minor version
increment: Minor
source-branches: [ "main", "feature", "release" ]
pull-request:
label: pr{BranchName}
regex: ^pull/(?<BranchName>[^/-]+)/merge$
unknown:
mode: ContinuousDelivery
# we usually don't distinguish feature from fix in our branch names
# So EVERYTHING ELSE just increments the patch version
regex: ^.*[-/](?<BranchName>[^/-]+)$
increment: Patch
# label: alpha.{BranchName}.
source-branches: [ "main", "release", "feature" ]
track-merge-target: true
tracks-release-branches: true