fix(releases): don't drop the prerelease marker when comparing versions

A MinVer dev build on main computes a prerelease of its own guessed next
version (e.g. 2.9.1-alpha.0.14 after tag v2.9.0), which already sorts
above the last tag by numeric core, so the update banner correctly
stays quiet there. But the reduction to a bare numeric core meant a
genuine new release landing at exactly that guessed version (v2.9.1
real) compared equal to the still-running prerelease and the banner
never fired. A prerelease now only loses to a real release of the same
core, not to another prerelease of the same core.

Verified against the live repo: latest published tag is v2.9.0; a
Release build of this worktree (14 commits ahead) reports
AssemblyInformationalVersion 2.9.1-alpha.0.14+<sha>.
This commit is contained in:
mika kuns
2026-08-10 14:27:23 +02:00
parent 6a2a19cc9e
commit 84715665c2
3 changed files with 26 additions and 2 deletions
+3 -1
View File
@@ -111,7 +111,9 @@ sealed class Program
var releases = sp.GetRequiredService<IReleaseClient>();
var informational = Assembly.GetEntryAssembly()?
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;
// Strip MinVer build metadata ("+sha") and any prerelease suffix for the update-compare.
// Strip MinVer build metadata ("+sha") only — keep the prerelease suffix
// (e.g. "-alpha.0.14"), VersionComparer needs it to tell a dev build on
// main apart from a tagged release of the same numeric core.
var version = (informational ?? "0.0.0").Split('+')[0];
return new UpdateCheckService(releases, version);
});