Use next minor version with beta suffix for prereleases

- Changed prerelease versioning to increment minor version instead of using last tag
- Changed suffix from "preview" to "beta"
- Format is now {NEXT_MINOR_VERSION}-beta.{COMMIT_COUNT}
- Example: 0.43.0-beta.123 (if last tag is 0.42.x)
- Updated documentation in NUGET_RELEASE.md and TESTING.md

Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-03 11:23:32 +00:00
parent d5913e8371
commit 9d6cd930ea
3 changed files with 13 additions and 9 deletions

View File

@@ -280,7 +280,7 @@ static (string version, bool isPrerelease) GetVersion()
}
else
{
// Not tagged - create prerelease version based on last tag
// Not tagged - create prerelease version based on next minor version
var allTags = GetGitOutput("tag", "--list")
.Split('\n', StringSplitOptions.RemoveEmptyEntries)
.Where(tag => Regex.IsMatch(tag.Trim(), @"^\d+\.\d+\.\d+$"))
@@ -288,10 +288,14 @@ static (string version, bool isPrerelease) GetVersion()
.ToList();
var lastTag = allTags.OrderBy(tag => Version.Parse(tag)).LastOrDefault() ?? "0.0.0";
var lastVersion = Version.Parse(lastTag);
// Increment minor version for next release
var nextVersion = new Version(lastVersion.Major, lastVersion.Minor + 1, 0);
var commitCount = GetGitOutput("rev-list", "--count HEAD").Trim();
var version = $"{lastTag}-preview.{commitCount}";
var version = $"{nextVersion}-beta.{commitCount}";
Console.WriteLine($"Building prerelease version: {version}");
return (version, true);
}