File tree Expand file tree Collapse file tree 5 files changed +24
-2
lines changed
Expand file tree Collapse file tree 5 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 99 runs-on : ubuntu-latest
1010 steps :
1111 - uses : actions/checkout@v4
12+ with :
13+ fetch-depth : 0
1214 - name : Create and Push new tag
1315 shell : pwsh
1416 run : |
Original file line number Diff line number Diff line change 99 runs-on : ubuntu-latest
1010 steps :
1111 - uses : actions/checkout@v4
12+ with :
13+ fetch-depth : 0
1214 - name : Create and Push new tag
1315 shell : pwsh
1416 run : |
Original file line number Diff line number Diff line change 99 runs-on : ubuntu-latest
1010 steps :
1111 - uses : actions/checkout@v4
12+ with :
13+ fetch-depth : 0
1214 - name : Create and Push new tag
1315 shell : pwsh
1416 run : |
1517 . ./Scripts/VersionManager.ps1
16- New-Tag -Branch "master"
18+ New-Tag -Branch "master" -SourceBranch "${{ github.head_ref }}"
Original file line number Diff line number Diff line change 99 runs-on : ubuntu-latest
1010 steps :
1111 - uses : actions/checkout@v4
12+ with :
13+ fetch-depth : 0
1214 - name : Create and Push new tag
1315 shell : pwsh
1416 run : |
Original file line number Diff line number Diff line change @@ -5,28 +5,42 @@ function New-Tag
55{
66 param (
77 [Parameter (Mandatory = $true )]
8- [string ]$Branch
8+ [string ]$Branch ,
9+
10+ [Parameter (Mandatory = $false )]
11+ [string ]$SourceBranch = " "
912 )
1013
1114 $version = Get-CurrentVersion
1215 $patch = Get-NewPatch
1316 $prefix = " "
1417
18+ # Release branch needs to increase version and add "Beta-" prefix
1519 if ($Branch -eq " release" )
1620 {
1721 $version = ([decimal ]$version + 0.1 ).ToString()
1822 $prefix = " Beta-"
1923 }
24+
25+ # Develop branch needs to increase version and add "Dev-" prefix
2026 if ($Branch -eq " develop" )
2127 {
2228 $version = ([decimal ]$version + 0.1 ).ToString()
2329 $prefix = " Dev-"
2430 }
31+
32+ # Hotfix branch just needs to add "HF-" prefix
2533 if ($Branch -eq " hotfix" )
2634 {
2735 $prefix = " HF-"
2836 }
2937
38+ # Increase version if merge from "release" branch to "master" branch
39+ if ($Branch -eq " master" -and $SourceBranch -eq " release" )
40+ {
41+ $version = ([decimal ]$version + 0.1 ).ToString()
42+ }
43+
3044 $tag = " v$version .$prefix$patch "
3145
3246 Invoke-Expression " git tag $tag "
You can’t perform that action at this time.
0 commit comments