From a9d78e7b1a384736051b4f7fe0829f4b37b792d6 Mon Sep 17 00:00:00 2001 From: Shaun Lawrie Date: Fri, 30 Aug 2024 23:59:56 +1200 Subject: [PATCH] Fix version bump --- .github/workflows/build-test-publish.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test-publish.yml b/.github/workflows/build-test-publish.yml index 668efc77..a379e5ff 100644 --- a/.github/workflows/build-test-publish.yml +++ b/.github/workflows/build-test-publish.yml @@ -94,13 +94,17 @@ jobs: Write-Host "Latest prerelease version is less than the latest stable version, jumping to $currentVersion" $newPrereleaseTag = "prerelease1" $newVersion = $currentVersion + } elseif ($latestPrereleaseVersion -eq $currentVersion) { + Write-Host "Latest prerelease version is the same as the latest stable version, jumping to $currentVersion" + $newPrereleaseTag = "prerelease" + (([int]$latestPrereleaseTag) + 1) + $newVersion = $currentVersion } else { # Generate a new prerelease name, psgallery only allows characters 'a-zA-Z0-9' and a hyphen ('-') at the beginning of the prerelease string $newPrereleaseTag = "prerelease" + (([int]$latestPrereleaseTag) + 1) # Prerelease will always be at least one minor version above the latest published stable version so when it's merged to main the minor version will get bumped # To bump a major version the manifest would be edited manually to vnext.0.0 before merging to main - $newVersion = [version]::new($latestStableVersion.Major, $latestStableVersion.Minor + 1, 0) + $newVersion = [version]::new($latestPrereleaseVersion.Major, $latestPrereleaseVersion.Minor + 1, 0) } if($newVersion -eq $oldVersion) {