File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed
Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change 4747 # Initialize BUILD_NEEDED with default value
4848 $BUILD_NEEDED = $false
4949
50- # Get the latest release tag to determine release type
51- $LATEST_TAG = git tag -l --sort=-version:refname | Select-Object -First 1
52- Write-Host "`n[INFO] Latest release tag: $LATEST_TAG" -ForegroundColor Green
50+ # Get the latest stable release tag (without prerelease suffix)
51+ # Note: We prioritize stable releases over prereleases for comparison
52+ # Git's version sort treats v2.10.0-0 as greater than v2.10.0, which is incorrect
53+ # for our purposes. We want to compare against the latest stable release.
54+ $LATEST_STABLE_TAG = git tag -l --sort=-version:refname | Where-Object { $_ -notlike "*-*" } | Select-Object -First 1
55+ $LATEST_PRERELEASE_TAG = git tag -l --sort=-version:refname | Where-Object { $_ -like "*-*" } | Select-Object -First 1
56+
57+ # Use the latest stable tag as our reference point
58+ # If no stable tag exists, fall back to the latest prerelease
59+ if ($LATEST_STABLE_TAG) {
60+ $LATEST_TAG = $LATEST_STABLE_TAG
61+ Write-Host "`n[INFO] Latest stable release tag: $LATEST_TAG" -ForegroundColor Green
62+ if ($LATEST_PRERELEASE_TAG) {
63+ Write-Host "[INFO] Latest prerelease tag (ignored for comparison): $LATEST_PRERELEASE_TAG" -ForegroundColor DarkGray
64+ }
65+ } else {
66+ $LATEST_TAG = $LATEST_PRERELEASE_TAG
67+ Write-Host "`n[INFO] No stable release found, using latest prerelease: $LATEST_TAG" -ForegroundColor Yellow
68+ }
5369
5470 # Determine release type based on previous tag
5571 if ($LATEST_TAG -like "*-*") {
You can’t perform that action at this time.
0 commit comments