File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : CI on Develop branch
2+ on :
3+ push :
4+ branches : [ develop ]
5+ workflow_dispatch :
6+
7+ jobs :
8+ create-new-tag :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v4
12+ - name : Create new tag
13+ shell : pwsh
14+ run : |
15+ . ./Scripts/VersionManager.ps1
16+ New-Tag -Branch "develop"
17+
Original file line number Diff line number Diff line change 11# ################################
22# This script contains funtions to create git tags following GitFlow
33# ################################
4+ function New-Tag
5+ {
6+ param (
7+ [Parameter (Mandatory = $true )]
8+ [string ]$Branch
9+ )
10+
11+ $version = Get-CurrentVersion
12+ $patch = Get-NewPatch
13+ $prefix = " "
14+
15+ if ($Branch -eq " release" )
16+ {
17+ $version = ([decimal ]$currentVersion + 0.1 ).ToString()
18+ $prefix = " Beta-"
19+ }
20+ if ($Branch -eq " develop" )
21+ {
22+ $version = ([decimal ]$currentVersion + 0.1 ).ToString()
23+ $prefix = " Dev-"
24+ }
25+ if ($Branch -eq " hotfix" )
26+ {
27+ $version = ([decimal ]$currentVersion + 0.1 ).ToString()
28+ $prefix = " HF-"
29+ }
30+
31+ $tag = " v$version .$prefix$patch "
32+
33+ Invoke-Expression " git tag $tag "
34+
35+ return $tag
36+ }
437
538function Get-CurrentVersion
639{
@@ -35,17 +68,17 @@ function Get-CurrentVersion
3568
3669function Get-NewPatch
3770{
38- param (
71+ param (
3972 [Parameter (Mandatory = $false )]
4073 [string ]$Prefix = " "
4174 )
4275
43- if ($Prefix -ne " " )
76+ if ($Prefix -eq " " )
4477 {
45- return $Prefix + " - " + (Get-Date ).ToString(" yyMMddhhmmss" )
78+ return (Get-Date ).ToString(" yyMMddhhmmss" )
4679 }
4780
48- return (Get-Date ).ToString(" yyMMddhhmmss" )
81+ return $Prefix + " - " + (Get-Date ).ToString(" yyMMddhhmmss" )
4982}
5083
5184function Get-NextVersion
@@ -58,4 +91,4 @@ function Get-GitTags
5891{
5992 $tags = Invoke-Expression " git tag --list"
6093 $tags
61- }
94+ }
You can’t perform that action at this time.
0 commit comments