Skip to content

Commit 918fd8b

Browse files
committed
Doc updat, minor GitVersion config update
1 parent f23a721 commit 918fd8b

3 files changed

Lines changed: 26 additions & 23 deletions

File tree

GitVersion.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
1+
# This is the original version of GitVersion.yml. It does not invrement main
2+
# version on every commit, increments minor version on dev branch after
3+
# branching off main and adds `beta` suffix plus numbe r to versions on the
4+
# develop branch, and versions other branches similarly.
5+
#
6+
# * Commits on main produce versions like 1.2.3.
7+
# * Commits on develop produce pre-releases like 1.3.0-beta.4.
8+
# * You can tune increment rules per branch, or add feature/* branches to get 1.3.0-feature.mybranch.1.
9+
110

211
# Configuration file for the GitVersion tool.
312

4-
# mode: ContinuousDeployment # commented - we leave it to built-in config
13+
mode: ContinuousDeployment
514
workflow: GitHubFlow/v1
6-
strategies:
7-
# This enables incrementing the patch number on main branch with each commit:
8-
# # - ConfiguredNextVersion
9-
- Mainline
1015
branches:
11-
# Configuration for main branch:
1216
main:
13-
# Match either "main" or "master" at main branch
1417
regex: ^master$|^main$
1518
label: ''
16-
# Patch number increases with new commits on the main branch
1719
increment: Patch
1820
is-release-branch: true
1921
is-main-branch: true
2022
develop:
2123
regex: ^develop$
22-
# Add the "alpha" + incremented number suffix on develop branch:
23-
label: 'alpha'
24-
increment: Patch
24+
label: beta
25+
increment: Minor
2526
ignore:
2627
sha: []
2728
commit-message-incrementing: Enabled

GitVersion_CP1.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
# mode: ContinuousDeployment # commented - we leave it to built-in config
88
workflow: GitHubFlow/v1
9-
strategies:
9+
# strategies:
1010
# This enables incrementing the patch number on main branch with each commit:
1111
# # - ConfiguredNextVersion
12-
- Mainline
12+
# - Mainline
1313
branches:
1414
# Configuration for main branch:
1515
main:

README_Development.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,11 @@ You can **override behavior with certain strings in commit messages** ([see conf
171171
> `GitVersion` **does not work when projects / solutions are built in Visual Studio**. This is because `GitVersion` developers only support later .NET LTS and the tool needs .NET Core runtime (see [this Github Discussion](https://github.com/GitTools/GitVersion/discussions/4130)). `Visual Studio` uses stand-alone `MSBuild` that is built *for .NET Framework*, and this cannot be changed (Microsoft only releases MsBuild that is built for .NET Framework).
172172
> When **building or packaging with the `dotnet` tool**, **`GitVersion` works** because the `dotnet` tool contains an embedded MSBuild that is built for .NET (Core) (see [this Stack Overflow answer](https://stackoverflow.com/questions/79584977/how-can-i-force-visual-studio-to-use-msbuild-for-net-9)).
173173
174-
In order to use GitVersion efficiently, you should tag at least the versions of main branch that are released ot published somewhere. If you know the version you want to asign, can do this on a local repostory using something like this:
174+
### Manually Handling Tags
175+
176+
In order to use GitVersion efficiently, you should **tag at least the versions of main branch that are released ot published somewhere**.
177+
178+
If you know the version tag you want to asign, you can do this on a local repostory using something like this:
175179

176180
~~~powershell
177181
# Tag the current commit on main as 1.4.0:
@@ -181,7 +185,7 @@ git tag -a v1.4.0 -m "Release 1.4.0"
181185
git push origin v1.4.0
182186
~~~
183187

184-
Manual tagging is error prone, and it is easy to create a wrong tag. One mitigation is to run a script where after updating the main branch, the current version is calculated by GitVersion (which correctly increments major, minor and patch numbers when commits are added and branched merged), then use this version in tagging. Below is a **PowerShell script* that tags the `main` branch with correct version number*:
188+
Manual **tagging a branch** is error prone, and it is easy to create a wrong tag. One mitigation is to run a script where the **current version** is **calculated by GitVersion** (which correctly increments major, minor and patch numbers when commits are added and branched merged), then use this version in tagging. Below is a **PowerShell script** that **tags the `main` branch with correct version number**:
185189

186190
~~~powershell
187191
# Update the main branch:
@@ -194,8 +198,6 @@ git tag -a "v${CurrentVersion}" -m "Released version ${CurrentVersion}"
194198
git push origin "v${CurrentVersion}"
195199
~~~
196200

197-
**Manually Handling Tags**:
198-
199201
It may happen that come commits were wrongly tagged by version tags. In such cases, manual interventions with checking, deleting or re-aplying correct tags may be necessary. Here are some basic tips.
200202

201203
Showing tags:
@@ -254,7 +256,7 @@ See detailed workflow on the Wiki .
254256

255257
This section contains unarranged quick notes on what needs to be done.
256258

257-
### Versioning
259+
**Versioning**:
258260

259261
* Documentation
260262
* Wiki:
@@ -263,11 +265,11 @@ This section contains unarranged quick notes on what needs to be done.
263265
* scripts/TagVersion.ps1:
264266
* Restore branch after operation: move `$currentBranch = ...` before try, restore in finally block
265267
* Check Bump (ensure all variants work)
266-
* add Bump...Num *NumBumps* - specifies how much to bump
267-
* Copy the right version of script and GitVersion.yml to:
268-
* IGLibScripts
269-
* All IGLib Core repos
270-
* Selected IGLib legacy repos
268+
* Add Bump...Num *NumBumps* - specifies how much to bump
269+
* Copy the right version of script and GitVersion.yml to:
270+
* IGLibScripts
271+
* All IGLib Core repos
272+
* Selected IGLib legacy repos
271273

272274
### Helper Scripts
273275

0 commit comments

Comments
 (0)