diff --git a/.github/workflows/build-test-publish.yml b/.github/workflows/build-test-publish.yml index 61883d16..1be99fe9 100644 --- a/.github/workflows/build-test-publish.yml +++ b/.github/workflows/build-test-publish.yml @@ -79,7 +79,11 @@ jobs: $latestStableVersion = $onlineVersions | Where-Object { $_.Version -notlike "*prerelease*" } | Sort-Object -Property Version -Descending | Select-Object -First 1 -ExpandProperty Version $latestStableVersion = [version]$latestStableVersion - $latestPrereleaseVersion = $onlineVersions | Where-Object { $_.Version -like "*prerelease*" } | Sort-Object -Property Version -Descending | Select-Object -First 1 -ExpandProperty Version + $latestPrereleaseVersion = $onlineVersions | Where-Object { $_.Version -like "*prerelease*" } | Sort-Object { + $version = [version]$_.Version.Split("-")[0] + $version = [version]::new($version.Major, $version.Minor, $version.Build, ($_.Version.Split("-")[1] -replace "prerelease", "")) + return $version + } -Descending | Select-Object -First 1 -ExpandProperty Version $latestPrereleaseTag = $latestPrereleaseVersion.Split("-prerelease")[1] # format is like -prerelease6, output here is just 6 $latestPrereleaseVersion = [version]$latestPrereleaseVersion.Split("-prerelease")[0]