build: manage version via MinVer with AssemblyInformationalVersion
Uses MinVer to derive the version from git tags (prefix "v"), stored in AssemblyInformationalVersion. Program.cs reads that attribute (stripping the "+sha" build metadata) so the update-check compares against a clean semver. CI overrides the tag via /p:MinVerVersionOverride=$VERSION.
This commit is contained in:
@@ -85,7 +85,10 @@ sealed class Program
|
||||
sc.AddSingleton(sp =>
|
||||
{
|
||||
var releases = sp.GetRequiredService<IReleaseClient>();
|
||||
var version = Assembly.GetEntryAssembly()?.GetName().Version?.ToString() ?? "0.0.0.0";
|
||||
var informational = Assembly.GetEntryAssembly()?
|
||||
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;
|
||||
// Strip MinVer build metadata ("+sha") and any prerelease suffix for the update-compare.
|
||||
var version = (informational ?? "0.0.0").Split('+')[0];
|
||||
return new UpdateCheckService(releases, version);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user