Print FullSemVer or InformationalVersion and source URL to the Banner
BinToss opened this issue · 1 comments
BinToss commented
...depending on if the current assembly was built from a tagged Release commit.
readonly string BannerBuildSource = GitVersion_FullSemVer;
string BannerUrl = "https://github.com/HaloSPV3/HXE/";
bool IsReleaseBuild = GitVersion_BranchName == "main" && GitVersion_PreReleaseNumber == 0;
if (IsReleaseBuild)
{
BannerBuildSource = GitVersion_FullSemVer
BannerUrl = BannerUrl + $"releases/v{GitVersion_MajorMinorPatch}";
}
else
{
BannerBuildSource = GitVersion_InformationalVersion;
BannerUrl = BannerUrl + $"commit/{GitVersion_ShortSha}";
}
Links and Refs
var attr2 = Attribute
.GetCustomAttribute(
Assembly.GetEntryAssembly(),
typeof(AssemblyInformationalVersionAttribute))
as AssemblyInformationalVersionAttribute;