Skip to content

Commit 578e11f

Browse files
Merge pull request #10 from vndevpro/release
Release
2 parents fbacc7a + 7db6540 commit 578e11f

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
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: 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-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: |

Readme.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# PowerSell Versioning Script
22

3-
This script contains functions to manage git tags for software versions
3+
This script contains functions to manage git tags for software versions.
4+
5+
Also there are sample Actions to trigger on each branch master/develop/release/hotfix.

Scripts/VersionManager.ps1

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,11 @@ function New-Tag
3737

3838
function Get-CurrentVersion
3939
{
40+
$major = 0; $minor = 1
4041
$tags = Get-GitTags
4142

4243
if ($tags.Count -gt 0)
4344
{
44-
$major = 0; $minor = 1
45-
4645
foreach($tag in $tags)
4746
{
4847
$pattern = '^v(\d+)\.(\d+)\.\d+$'
@@ -59,11 +58,9 @@ function Get-CurrentVersion
5958
}
6059
}
6160
}
62-
63-
return "$major.$minor"
6461
}
6562

66-
return "0.1"
63+
return "$major.$minor"
6764
}
6865

6966
function Get-NewPatch
@@ -81,12 +78,6 @@ function Get-NewPatch
8178
return $Prefix + "-" + (Get-Date).ToString("yyMMddhhmmss")
8279
}
8380

84-
function Get-NextVersion
85-
{
86-
$currentVersion = Get-CurrentVersion
87-
return ([decimal]$currentVersion + 0.1).ToString()
88-
}
89-
9081
function Get-GitTags
9182
{
9283
$tags = Invoke-Expression "git tag --list"

0 commit comments

Comments
 (0)