From c48d1af618a9a78f50811e12ba4073d1c0481c96 Mon Sep 17 00:00:00 2001 From: juanonsoftware Date: Sun, 20 Jul 2025 14:35:39 +0700 Subject: [PATCH 1/4] Feature F2: just update readme --- Readme.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index abbd2c3..ce721d7 100644 --- a/Readme.md +++ b/Readme.md @@ -1,3 +1,5 @@ # PowerSell Versioning Script -This script contains functions to manage git tags for software versions \ No newline at end of file +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. From d155a4d76eea62655b015194d35a5cd881eb8195 Mon Sep 17 00:00:00 2001 From: juanonsoftware Date: Sun, 20 Jul 2025 14:59:35 +0700 Subject: [PATCH 2/4] Update PS1 --- Scripts/VersionManager.ps1 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Scripts/VersionManager.ps1 b/Scripts/VersionManager.ps1 index 3258c9f..cf73487 100644 --- a/Scripts/VersionManager.ps1 +++ b/Scripts/VersionManager.ps1 @@ -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+$' @@ -59,11 +58,9 @@ function Get-CurrentVersion } } } - - return "$major.$minor" } - return "0.1" + return "$major.$minor" } function Get-NewPatch From 59f48ae8150c12d86b0d83a46a1cec2cf69a3245 Mon Sep 17 00:00:00 2001 From: juanonsoftware Date: Sun, 20 Jul 2025 15:03:23 +0700 Subject: [PATCH 3/4] Update script PS1 --- Scripts/VersionManager.ps1 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Scripts/VersionManager.ps1 b/Scripts/VersionManager.ps1 index cf73487..4f32998 100644 --- a/Scripts/VersionManager.ps1 +++ b/Scripts/VersionManager.ps1 @@ -78,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" From 7db65403f2e45f516d712c3156f26b02ad2a6a66 Mon Sep 17 00:00:00 2001 From: juanonsoftware Date: Sun, 20 Jul 2025 15:09:31 +0700 Subject: [PATCH 4/4] Fix CI to fetch all history of git repo --- .github/workflows/ci-develop.yml | 2 ++ .github/workflows/ci-hotfix.yml | 2 ++ .github/workflows/ci-master.yml | 2 ++ .github/workflows/ci-release.yml | 2 ++ 4 files changed, 8 insertions(+) diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index e7a83b9..c7c7b14 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -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: | diff --git a/.github/workflows/ci-hotfix.yml b/.github/workflows/ci-hotfix.yml index 958598c..9e7f16d 100644 --- a/.github/workflows/ci-hotfix.yml +++ b/.github/workflows/ci-hotfix.yml @@ -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: | diff --git a/.github/workflows/ci-master.yml b/.github/workflows/ci-master.yml index b9c6a43..2878262 100644 --- a/.github/workflows/ci-master.yml +++ b/.github/workflows/ci-master.yml @@ -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: | diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index 983e607..0d595bc 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -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: |