Skip to content

Commit 9ac4fa0

Browse files
authored
Merge pull request #883 from Romanitho/hotfix/versionning
Fix versioning with the latest changes regarding GitFlow
2 parents a06cb7e + 9f07e1a commit 9ac4fa0

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

.github/workflows/GitFlow_Make-Release-and-Sync-to-Dev.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ jobs:
5757
commit_count_mod=$((commit_count % 65535))
5858
NEW_VERSION="$VERSION.$commit_count_mod"
5959
echo "Final version: $NEW_VERSION"
60-
echo "newversion=$NEW_VERSION" >> $GITHUB_OUTPUT
61-
echo "version=$VERSION" >> $GITHUB_OUTPUT
60+
echo "MsiVersion=$NEW_VERSION" >> $GITHUB_OUTPUT
61+
echo "NextSemVer=$VERSION" >> $GITHUB_OUTPUT
6262
6363
# Step 3: Build all project artifacts for the stable release
6464
- name: Build project
@@ -85,7 +85,7 @@ jobs:
8585
# Build MSI package with STABLE flag
8686
echo "### Create WAU msi ###"
8787
cd .\Sources\Wix\
88-
wix build -src build.wxs -ext WixToolset.Util.wixext -ext WixToolset.UI.wixext -out ..\..\WAU.msi -arch x64 -d Version=${{ steps.release_version.outputs.newversion }} -d NextSemVer=${{ steps.release_version.outputs.newversion }} -d Comment="STABLE" -d PreRelease=0
88+
wix build -src build.wxs -ext WixToolset.Util.wixext -ext WixToolset.UI.wixext -out ..\..\WAU.msi -arch x64 -d Version=${{ steps.release_version.outputs.MsiVersion }} -d NextSemVer=${{ steps.release_version.outputs.NextSemVer }} -d Comment="STABLE" -d PreRelease=0
8989
cd ..\..
9090
Get-Item .\WAU.msi
9191
@@ -114,19 +114,19 @@ jobs:
114114
- name: Create release
115115
uses: ncipollo/release-action@440c8c1cb0ed28b9f43e4d1d670870f059653174 # v1.16.0
116116
with:
117-
tag: v${{ steps.release_version.outputs.version }}
117+
tag: v${{ steps.release_version.outputs.NextSemVer }}
118118
prerelease: false # This is a stable release
119119
generateReleaseNotes: true
120-
name: WAU ${{ steps.release_version.outputs.version }}
120+
name: WAU ${{ steps.release_version.outputs.NextSemVer }}
121121
artifacts: "WAU.msi,WAU_ADMX.zip,WAU_InstallCounter"
122122
body: |
123123
## Files
124124
|Files|Hash (SHA256)|Downloads|
125125
|---|---|---|
126-
|[WAU.msi](https://github.com/Romanitho/Winget-AutoUpdate/releases/download/v${{ steps.release_version.outputs.version }}/WAU.msi) (x64)|`${{ steps.build_project.outputs.msi_sha }}`|<picture>![WAU.msi](https://img.shields.io/github/downloads/Romanitho/Winget-AutoUpdate/v${{ steps.release_version.outputs.version }}/WAU.msi?style=flat-square&label=&color=blue)</picture>|
127-
|[WAU_ADMX.zip](https://github.com/Romanitho/Winget-AutoUpdate/releases/download/v${{ steps.release_version.outputs.version }}/WAU_ADMX.zip)|`${{ steps.build_project.outputs.admx_sha }}`|<picture>![WAU_ADMX.zip](https://img.shields.io/github/downloads/Romanitho/Winget-AutoUpdate/v${{ steps.release_version.outputs.version }}/WAU_ADMX.zip?style=flat-square&label=&color=blue)</picture>|
126+
|[WAU.msi](https://github.com/Romanitho/Winget-AutoUpdate/releases/download/v${{ steps.release_version.outputs.NextSemVer }}/WAU.msi) (x64)|`${{ steps.build_project.outputs.msi_sha }}`|<picture>![WAU.msi](https://img.shields.io/github/downloads/Romanitho/Winget-AutoUpdate/v${{ steps.release_version.outputs.NextSemVer }}/WAU.msi?style=flat-square&label=&color=blue)</picture>|
127+
|[WAU_ADMX.zip](https://github.com/Romanitho/Winget-AutoUpdate/releases/download/v${{ steps.release_version.outputs.NextSemVer }}/WAU_ADMX.zip)|`${{ steps.build_project.outputs.admx_sha }}`|<picture>![WAU_ADMX.zip](https://img.shields.io/github/downloads/Romanitho/Winget-AutoUpdate/v${{ steps.release_version.outputs.NextSemVer }}/WAU_ADMX.zip?style=flat-square&label=&color=blue)</picture>|
128128
129-
<picture>![Install counter](https://img.shields.io/github/downloads/Romanitho/Winget-AutoUpdate/v${{ steps.release_version.outputs.version }}/WAU_InstallCounter?style=flat-square&label=Total%20reported%20installations%20for%20this%20release&color=blue)</picture>
129+
<picture>![Install counter](https://img.shields.io/github/downloads/Romanitho/Winget-AutoUpdate/v${{ steps.release_version.outputs.NextSemVer }}/WAU_InstallCounter?style=flat-square&label=Total%20reported%20installations%20for%20this%20release&color=blue)</picture>
130130
131131
# Step 5: Configure Git for merge back to develop
132132
- name: Configure Git
@@ -144,7 +144,7 @@ jobs:
144144
git pull origin develop
145145
146146
# Merge main into develop with no fast-forward to preserve history
147-
git merge --no-ff origin/main -m "Merge main into develop after the creation of release v${{ steps.release_version.outputs.version }}"
147+
git merge --no-ff origin/main -m "Merge main into develop after the creation of release v${{ steps.release_version.outputs.NextSemVer }}"
148148
149149
# Push changes to develop branch
150150
git push origin develop

Sources/Winget-AutoUpdate/Winget-Upgrade.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ if (Test-Network) {
208208
#Get Available Version
209209
$Script:WAUAvailableVersion = Get-WAUAvailableVersion;
210210
#Compare
211-
if ([version]$WAUAvailableVersion.replace("-n", "") -gt [version]$WAUCurrentVersion.replace("-n", "")) {
211+
if ((Compare-SemVer -Version1 $WAUCurrentVersion -Version2 $WAUAvailableVersion) -lt 0) {
212212
#If new version is available, update it
213213
Write-ToLog "WAU Available version: $WAUAvailableVersion" "Yellow";
214214
Update-WAU;

Sources/Winget-AutoUpdate/functions/Install-Prerequisites.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ function Install-Prerequisites {
9191
$WinGetAvailableVersion = ((Invoke-WebRequest $WinGeturl -UseBasicParsing | ConvertFrom-Json)[0].tag_name).TrimStart("v")
9292
}
9393
catch {
94-
#if fail set version to the latest version as of 2024-04-29
95-
$WinGetAvailableVersion = "1.7.11132"
94+
#If fail set version to the latest version as of 2025-03-14
95+
$WinGetAvailableVersion = "1.10.340"
9696
}
9797
try {
9898
#Get Admin Context Winget Location
@@ -104,6 +104,7 @@ function Install-Prerequisites {
104104
}
105105
catch {
106106
Write-ToLog "WinGet is not installed" "Red"
107+
$WinGetInstalledVersion = "0.0.0"
107108
}
108109
Write-ToLog "WinGet installed version: $WinGetInstalledVersion | WinGet available version: $WinGetAvailableVersion"
109110
#Check if the currently installed version is less than the available version

0 commit comments

Comments
 (0)