Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create and Push new tag
shell: pwsh
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci-hotfix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create and Push new tag
shell: pwsh
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create and Push new tag
shell: pwsh
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create and Push new tag
shell: pwsh
run: |
Expand Down
4 changes: 3 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# PowerSell Versioning Script

This script contains functions to manage git tags for software versions
This script contains functions to manage git tags for software versions.

Also there are sample Actions to trigger on each branch master/develop/release/hotfix.
13 changes: 2 additions & 11 deletions Scripts/VersionManager.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@ function New-Tag

function Get-CurrentVersion
{
$major = 0; $minor = 1
$tags = Get-GitTags

if ($tags.Count -gt 0)
{
$major = 0; $minor = 1

foreach($tag in $tags)
{
$pattern = '^v(\d+)\.(\d+)\.\d+$'
Expand All @@ -59,11 +58,9 @@ function Get-CurrentVersion
}
}
}

return "$major.$minor"
}

return "0.1"
return "$major.$minor"
}

function Get-NewPatch
Expand All @@ -81,12 +78,6 @@ function Get-NewPatch
return $Prefix + "-" + (Get-Date).ToString("yyMMddhhmmss")
}

function Get-NextVersion
{
$currentVersion = Get-CurrentVersion
return ([decimal]$currentVersion + 0.1).ToString()
}

function Get-GitTags
{
$tags = Invoke-Expression "git tag --list"
Expand Down