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) {