Skip to content

Commit 3c461de

Browse files
Merge pull request #11 from vndevpro/feature/f3
Feature/f3
2 parents 59f48ae + d6de368 commit 3c461de

File tree

5 files changed

+24
-2
lines changed

5 files changed

+24
-2
lines changed

.github/workflows/ci-develop.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ jobs:
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: |

.github/workflows/ci-hotfix.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ jobs:
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: |

.github/workflows/ci-master.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ jobs:
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 }}"

.github/workflows/ci-release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ jobs:
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: |

Scripts/VersionManager.ps1

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff 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"

0 commit comments

Comments
 (0)