Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,16 @@ jobs:
id: gitversion
uses: gittools/actions/gitversion/execute@v4

- name: Verify tag version output
if: startsWith(github.ref, 'refs/tags/v')
shell: pwsh
run: |
$expected = "${{ github.ref_name }}" -replace '^v', ''
$actual = "${{ steps.gitversion.outputs.semVer }}"
if ($actual -ne $expected) {
throw "GitVersion SemVer '$actual' did not match tag '$expected'."
}

- name: Restore dependencies
run: dotnet restore

Expand Down
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ assembly-versioning-scheme: MajorMinorPatch
branches:
main:
regex: ^(master|main)$
label: ''
label: alpha
increment: Patch

ignore:
Expand Down
17 changes: 17 additions & 0 deletions tests/OpenClaw.Tray.Tests/VersioningContractTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,23 @@ public void ProductProjects_DoNotHardcodeReleaseVersion()
string.Join(Environment.NewLine, offenders));
}

[Fact]
public void GitVersion_MainBranchPreservesAlphaReleaseTags()
{
var repoRoot = GetRepositoryRoot();
var configPath = Path.Combine(repoRoot, "GitVersion.yml");
var config = File.ReadAllText(configPath);
var mainBranchMatch = Regex.Match(
config,
@"(?ms)^ main:\s*$\r?\n(?<body>.*?)(?=^ \S|\z)",
RegexOptions.CultureInvariant);

Assert.True(mainBranchMatch.Success, "GitVersion.yml must configure the main branch.");
Assert.Matches(
@"(?m)^\s+label:\s*'?alpha'?\s*$",
mainBranchMatch.Groups["body"].Value);
}

[Fact]
public void ActiveCodeAndTests_DoNotContainStaleReleaseVersion()
{
Expand Down
Loading