From 199dbf75430a8078bf1c35805ffe289774eb8b76 Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Sat, 16 Feb 2019 20:31:35 -0600 Subject: [PATCH] Tweak pre-release package version --- build/Build.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/build/Build.cs b/build/Build.cs index 01e00319..8fcd3a2e 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -62,10 +62,22 @@ namespace LibHacBuild { AppVeyorVersion = $"{GitVersion.AssemblySemVer}-{GitVersion.PreReleaseTag}+{GitVersion.Sha.Substring(0, 8)}"; + string suffix = GitVersion.PreReleaseTag; + + if (!string.IsNullOrWhiteSpace(suffix)) + { + if (!GitRepository.IsOnMasterBranch()) + { + suffix = $"-{suffix}"; + } + + suffix += $"+{GitVersion.Sha.Substring(0, 8)}"; + } + VersionProps = new Dictionary { ["VersionPrefix"] = GitVersion.AssemblySemVer, - ["VersionSuffix"] = GitVersion.PreReleaseTag + ["VersionSuffix"] = suffix }; Console.WriteLine($"Building version {AppVeyorVersion}");