1 Commits
Author SHA1 Message Date
qwsdcvghyu89 b61d0836ac - Fix version increment logic by clamping values to valid range
- e.g. increment minor on 1.0.3 now results in 1.1.0 instead of 1.1.3
2025-09-21 17:00:16 +10:00
5 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -159,10 +159,10 @@ public static class Program {
ctx.Status = "Updating version"; ctx.Status = "Updating version";
var version = projectFile.GetVersion(); var version = projectFile.GetVersion();
version = ChangeVersion(version, version = ChangeVersion(version,
Target == IncrementTarget.Patch ? delta : 0, Target == IncrementTarget.Patch ? delta : int.MinValue,
Target == IncrementTarget.Minor ? delta : 0, Target == IncrementTarget.Minor ? delta : int.MinValue,
Target == IncrementTarget.Major ? delta : 0, Target == IncrementTarget.Major ? delta : int.MinValue,
(x, y) => x + y); (x, y) => int.Clamp(x + y, 0, int.MaxValue));
projectFile.SetVersion(version); projectFile.SetVersion(version);
} }
@@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("aeqw89.tools.Publish")] [assembly: System.Reflection.AssemblyCompanyAttribute("aeqw89.tools.Publish")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+ec8829bef24aaed18b9dee401887e40b480163f8")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+81bb2ea5c43fe48d78b65dc9e825889d8e041819")]
[assembly: System.Reflection.AssemblyProductAttribute("aeqw89.tools.Publish")] [assembly: System.Reflection.AssemblyProductAttribute("aeqw89.tools.Publish")]
[assembly: System.Reflection.AssemblyTitleAttribute("aeqw89.tools.Publish")] [assembly: System.Reflection.AssemblyTitleAttribute("aeqw89.tools.Publish")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
@@ -1 +1 @@
0f1cc2ca922aad2f0290b37da8e6f03b4c7c1d91f9ad5cc83a594ed2a3985e0b 53ec5207a57f615a2bd949ca74f6fa9f51b319acb2da66e55751d6a902498945
@@ -1 +1 @@
17584372191705345 17584372950452857
@@ -1 +1 @@
17584372319233411 17584377737753019