Skip to content

Commit a526216

Browse files
committed
CHANGE: Update GitVersion configuration and workflow
- Changed workflow to use Ubuntu instead of Windows - Updated GitVersion setup to version 6.3.x - Enhanced GitVersion configuration for Continuous Delivery - Added support for various branch types and increment strategies
1 parent acaf0be commit a526216

2 files changed

Lines changed: 83 additions & 6 deletions

File tree

.github/workflows/set-build-variables.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,34 @@ on:
1010
jobs:
1111
set-build-variables:
1212
name: Set build variables
13-
runs-on: windows-latest
13+
runs-on: ubuntu-latest
1414
outputs:
1515
build_version: ${{ steps.build_version.outputs.GitVersion_FullSemVer }}
16+
FullSemVer: ${{ steps.build_version.outputs.GitVersion_FullSemVer }}
17+
MajorMinorPatch: ${{ steps.build_version.outputs.GitVersion_MajorMinorPatch }}
18+
SemVer: ${{ steps.build_version.outputs.GitVersion_SemVer }}
19+
NuGetVersion: ${{ steps.build_version.outputs.GitVersion_NuGetVersionV2 }}
1620
steps:
1721
- name: Checkout repository
1822
uses: actions/checkout@v4
1923
with:
2024
fetch-depth: 0
2125

2226
- name: Install GitVersion
23-
uses: gittools/actions/gitversion/setup@v3.2.1
27+
uses: gittools/actions/gitversion/setup@v3.2.0
2428
with:
25-
versionSpec: '6.0.x'
29+
versionSpec: "6.3.x"
2630

2731
- name: Determine Version
2832
id: build_version
29-
uses: gittools/actions/gitversion/execute@v3.2.1
33+
uses: gittools/actions/gitversion/execute@v3.2.0
3034
with:
3135
useConfigFile: true
36+
configFilePath: GitVersion.yml
3237

33-
- name: Display FullSemVer
38+
- name: Display GitVersion outputs
3439
run: |
3540
echo "FullSemVer: ${{ steps.build_version.outputs.GitVersion_FullSemVer }}"
41+
echo "MajorMinorPatch: ${{ steps.build_version.outputs.GitVersion_MajorMinorPatch }}"
42+
echo "SemVer: ${{ steps.build_version.outputs.GitVersion_SemVer }}"
43+
echo "NuGetVersion: ${{ steps.build_version.outputs.GitVersion_NuGetVersionV2 }}"

GitVersion.yml

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,70 @@
1-
workflow: TrunkBased/preview1
1+
# GitVersion configuration for Continuous Delivery
2+
# Compatible with GitVersion 6.3.x
3+
mode: ContinuousDelivery
4+
5+
# Assembly versioning strategy
6+
assembly-versioning-scheme: MajorMinorPatch
7+
assembly-file-versioning-scheme: MajorMinorPatchTag
8+
assembly-informational-format: '{InformationalVersion}'
9+
10+
# Version increment strategy
11+
increment: Inherit
12+
13+
# Tag prefix for releases
14+
tag-prefix: 'v'
15+
16+
# Major version bump triggers
17+
major-version-bump-message: '\+semver:\s?(breaking|major)'
18+
minor-version-bump-message: '\+semver:\s?(feature|minor)'
19+
patch-version-bump-message: '\+semver:\s?(fix|patch)'
20+
21+
# Branch configuration for Continuous Delivery
22+
branches:
23+
# Main/Master branch - production releases
24+
main:
25+
regex: '^(main|master)$'
26+
mode: ContinuousDelivery
27+
label: ''
28+
increment: Patch
29+
30+
# Develop branch - pre-release versions
31+
develop:
32+
regex: '^dev(elop)?(ment)?$'
33+
mode: ContinuousDelivery
34+
label: 'alpha'
35+
increment: Minor
36+
37+
# Release branches - release candidates
38+
release:
39+
regex: '^releases?[/-]'
40+
mode: ContinuousDelivery
41+
label: 'beta'
42+
increment: None
43+
44+
# Feature branches
45+
feature:
46+
regex: '^features?[/-]'
47+
mode: ContinuousDelivery
48+
label: 'feature'
49+
increment: Inherit
50+
51+
# Pull request branches
52+
pull-request:
53+
regex: '^(pull|pull\-requests|pr)[/-]'
54+
mode: ContinuousDelivery
55+
label: 'pr'
56+
increment: Inherit
57+
58+
# Hotfix branches
59+
hotfix:
60+
regex: '^hotfix(es)?[/-]'
61+
mode: ContinuousDelivery
62+
label: 'beta'
63+
increment: Patch
64+
65+
# Support branches for maintenance
66+
support:
67+
regex: '^support[/-]'
68+
mode: ContinuousDelivery
69+
label: ''
70+
increment: Patch

0 commit comments

Comments
 (0)