-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathGitVersion.yml
More file actions
107 lines (91 loc) · 3.19 KB
/
Copy pathGitVersion.yml
File metadata and controls
107 lines (91 loc) · 3.19 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
---
# GitVersion Configuration
# This file controls semantic versioning behavior across different branches
# See https://gitversion.net/docs/ for full documentation
# Assembly versioning strategy
assembly-versioning-scheme: MajorMinorPatch
assembly-file-versioning-scheme: MajorMinorPatch
assembly-informational-format: '{InformationalVersion}'
# Versioning mode: ContinuousDeployment generates unique versions for every commit
mode: ContinuousDeployment
# Major/Minor version increment rules
# Set to manual to control version bumps via tags or commit messages
major-version-bump-message: '\+semver:\s?(breaking|major)'
minor-version-bump-message: '\+semver:\s?(feature|minor)'
patch-version-bump-message: '\+semver:\s?(fix|patch)'
# Commit date format for metadata
commit-date-format: 'yyyy-MM-dd'
# Ignore merge commits (except those that should trigger releases)
merge-message-formats: '^Merge (branch|tag|pull request)'
next-version: 'v0.3.1'
# Branch-specific configuration
branches:
# Main branch: Stable promotions
main:
# Prevent version jumping when merging from develop
# Version increments based on main's own version, not the merged branch
prevent-increment:
when-branch-merged: true
increment: Patch
is-main-branch: true
regex: ^master$|^main$
source-branches: ['develop', 'hotfix']
# Develop branch: Daily integration
develop:
# Allow normal version increment from merged branches
prevent-increment:
when-branch-merged: false
increment: Minor
# Beta tag for development releases
label: beta
# Continuous deployment mode for every commit
mode: ContinuousDeployment
regex: ^dev(elop)?(ment)?$
source-branches: ['feature', 'bugfix', 'hotfix']
track-merge-target: false
# Feature branches: Optional short-lived feature work
feature:
increment: Minor
# Alpha tag for feature development
label: 'alpha.{BranchName}.{number}'
regex: ^features?[/-](?<number>\d+)
source-branches: ['develop']
# Bugfix branches: Optional short-lived bugfix work
bugfix:
increment: Patch
label: 'bugfix.{BranchName}'
regex: ^bug(fix)?[/-]
source-branches: ['develop']
# Hotfix branches: Exceptional fixes based on main
hotfix:
increment: Patch
label: hotfix
regex: ^hotfix(es)?[/-]
source-branches: ['main']
is-main-branch: false
# Pull request branches: CI validation
pull-request:
increment: Inherit
label: 'pr{number}'
# Use PR number in version (e.g., 1.1.0-pr.123)
regex: ^(pull|pull\-requests|pr)[/-](?<number>\d+)
# Release branches: Release execution from main
release:
increment: None
label: rc
regex: ^releases?[/-]
source-branches: ['main']
is-main-branch: false
prevent-increment:
when-branch-merged: true
# Ignore commits with these patterns (won't trigger version increment)
ignore:
sha: []
# Workflow configuration for CI/CD
# Ensure GitVersion runs before build to inject version into assemblies
# continuous-delivery-fallback-label: ci
# Tag prefix (e.g., v1.0.0)
tag-prefix: 'v'
# Commit message increment rules
# Use commit messages like "feat: new feature +semver: minor" to control versioning
commit-message-incrementing: Enabled