Skip to content

Commit f46400a

Browse files
karkarlRomneyDa
andauthored
Support upstream stable correction release versions (#1266)
* feat(release): support upstream correction versions Treat numeric OpenClaw correction tags as stable releases while preserving exact product versions and monotonic updater ordering. Validate correction tags against upstream and serialize publication. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1c2a154c-928c-41b9-be0d-4209869d504d * test: prove correction update fallback * fix: align correction release contract --------- Co-authored-by: Dallin Romney <[email protected]> Copilot-Session: 1c2a154c-928c-41b9-be0d-4209869d504d
1 parent 5649f95 commit f46400a

12 files changed

Lines changed: 606 additions & 32 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 60 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,22 +61,49 @@ jobs:
6161
- name: Install GitVersion
6262
uses: gittools/actions/gitversion/setup@v4
6363
with:
64-
versionSpec: '6.4.x'
64+
versionSpec: '6.8.x'
6565

6666
- name: Determine Version
6767
id: gitversion
6868
uses: gittools/actions/gitversion/execute@v4
6969

70-
- name: Verify tag version output
71-
if: startsWith(github.ref, 'refs/tags/v')
70+
- name: Resolve release version
71+
id: release_version
7272
shell: pwsh
73+
env:
74+
GITVERSION_SEMVER: ${{ steps.gitversion.outputs.semVer }}
75+
GITVERSION_MAJOR_MINOR_PATCH: ${{ steps.gitversion.outputs.majorMinorPatch }}
76+
GH_TOKEN: ${{ github.token }}
7377
run: |
74-
$expected = "${{ github.ref_name }}" -replace '^v', ''
75-
$actual = "${{ steps.gitversion.outputs.semVer }}"
76-
if ($actual -ne $expected) {
77-
throw "GitVersion SemVer '$actual' did not match tag '$expected'."
78+
$semVer = $env:GITVERSION_SEMVER
79+
$majorMinorPatch = $env:GITVERSION_MAJOR_MINOR_PATCH
80+
$isPrerelease = $semVer.Contains("-")
81+
$isStableCorrection = $false
82+
83+
if ($env:GITHUB_REF.StartsWith("refs/tags/v", [StringComparison]::Ordinal)) {
84+
$tagVersion = $env:GITHUB_REF_NAME -replace '^v', ''
85+
$correction = [regex]::Match(
86+
$tagVersion,
87+
'^(?<base>(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*))-(?<revision>[1-9]\d*)$')
88+
89+
if ($correction.Success) {
90+
$validation = .\scripts\Test-OpenClawStableCorrectionRelease.ps1 `
91+
-Tag $env:GITHUB_REF_NAME `
92+
-GitHubToken $env:GH_TOKEN
93+
$semVer = $tagVersion
94+
$majorMinorPatch = $validation.BaseVersion
95+
$isPrerelease = $false
96+
$isStableCorrection = $true
97+
} elseif ($semVer -ne $tagVersion) {
98+
throw "GitVersion SemVer '$semVer' did not match tag '$tagVersion'."
99+
}
78100
}
79101

102+
"semVer=$semVer" >> $env:GITHUB_OUTPUT
103+
"majorMinorPatch=$majorMinorPatch" >> $env:GITHUB_OUTPUT
104+
"isPrerelease=$($isPrerelease.ToString().ToLowerInvariant())" >> $env:GITHUB_OUTPUT
105+
"isStableCorrection=$($isStableCorrection.ToString().ToLowerInvariant())" >> $env:GITHUB_OUTPUT
106+
80107
- name: Validate documentation
81108
shell: pwsh
82109
run: ./scripts/validate-docs.ps1
@@ -303,8 +330,10 @@ jobs:
303330
if-no-files-found: warn
304331

305332
outputs:
306-
semVer: ${{ steps.gitversion.outputs.semVer }}
307-
majorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}
333+
semVer: ${{ steps.release_version.outputs.semVer }}
334+
majorMinorPatch: ${{ steps.release_version.outputs.majorMinorPatch }}
335+
isPrerelease: ${{ steps.release_version.outputs.isPrerelease }}
336+
isStableCorrection: ${{ steps.release_version.outputs.isStableCorrection }}
308337

309338
e2etests:
310339
needs: repo-hygiene
@@ -452,6 +481,8 @@ jobs:
452481
build:
453482
needs: [test, e2etests]
454483
runs-on: ${{ matrix.rid == 'win-arm64' && 'windows-11-arm' || 'windows-latest' }}
484+
env:
485+
OPENCLAW_BUILD_VERSION: ${{ needs.test.outputs.semVer }}
455486
strategy:
456487
matrix:
457488
rid: [win-x64, win-arm64]
@@ -478,10 +509,10 @@ jobs:
478509
run: dotnet restore src/OpenClaw.Tray.WinUI -r ${{ matrix.rid }}
479510

480511
- name: Build WinUI Tray App (Release)
481-
run: dotnet build src/OpenClaw.Tray.WinUI --no-restore -c Release -r ${{ matrix.rid }}
512+
run: dotnet build src/OpenClaw.Tray.WinUI --no-restore -c Release -r ${{ matrix.rid }} -p:Version=$env:OPENCLAW_BUILD_VERSION -p:InformationalVersion=$env:OPENCLAW_BUILD_VERSION
482513

483514
- name: Publish WinUI Tray App
484-
run: dotnet publish src/OpenClaw.Tray.WinUI -c Release -r ${{ matrix.rid }} --self-contained --no-restore -o publish
515+
run: dotnet publish src/OpenClaw.Tray.WinUI -c Release -r ${{ matrix.rid }} --self-contained --no-restore -o publish -p:Version=$env:OPENCLAW_BUILD_VERSION -p:InformationalVersion=$env:OPENCLAW_BUILD_VERSION
485516

486517
- name: Verify x64 Native Runtime Payload
487518
if: matrix.rid == 'win-x64'
@@ -621,6 +652,9 @@ jobs:
621652
actions: read
622653
contents: write
623654
id-token: write
655+
concurrency:
656+
group: openclaw-windows-node-release
657+
cancel-in-progress: false
624658

625659
steps:
626660
- uses: actions/checkout@v7
@@ -777,7 +811,7 @@ jobs:
777811
copy artifacts/tray-win-x64/* publish-x64/ -Recurse
778812
.\scripts\Test-ReleaseNativeDependencies.ps1 -PayloadPath publish-x64 -RequireAppLocalVCRuntime -RequireInstallerVCRedist -InstallerVCRedistPath vc_redist.x64.exe
779813
# Build installer
780-
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /DMyAppVersion=${{ needs.test.outputs.majorMinorPatch }} /DMyAppArch=x64 /Dpublish=publish-x64 /DvcRedist=vc_redist.x64.exe installer.iss
814+
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /DMyAppVersion=${{ needs.test.outputs.semVer }} /DMyAppArch=x64 /Dpublish=publish-x64 /DvcRedist=vc_redist.x64.exe installer.iss
781815

782816
- name: Build arm64 Installer
783817
run: |
@@ -789,7 +823,7 @@ jobs:
789823
# LoadLibrary an arm64 DLL.
790824
.\scripts\Test-ReleaseNativeDependencies.ps1 -PayloadPath publish-arm64 -RequireAppLocalVCRuntime -RequireInstallerVCRedist -InstallerVCRedistPath vc_redist.arm64.exe -SkipNativeLoadProbe
791825
# Build installer
792-
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /DMyAppVersion=${{ needs.test.outputs.majorMinorPatch }} /DMyAppArch=arm64 /Dpublish=publish-arm64 /DvcRedist=vc_redist.arm64.exe installer.iss
826+
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /DMyAppVersion=${{ needs.test.outputs.semVer }} /DMyAppArch=arm64 /Dpublish=publish-arm64 /DvcRedist=vc_redist.arm64.exe installer.iss
793827

794828
- name: Sign Installers
795829
uses: azure/artifact-signing-action@v2
@@ -803,6 +837,17 @@ jobs:
803837
timestamp-rfc3161: http://timestamp.acs.microsoft.com
804838
timestamp-digest: SHA256
805839

840+
- name: Revalidate stable correction release ordering
841+
if: needs.test.outputs.isStableCorrection == 'true'
842+
shell: pwsh
843+
env:
844+
GH_TOKEN: ${{ github.token }}
845+
RELEASE_TAG: ${{ github.ref_name }}
846+
run: >
847+
.\scripts\Test-OpenClawStableCorrectionRelease.ps1
848+
-Tag $env:RELEASE_TAG
849+
-GitHubToken $env:GH_TOKEN
850+
806851
- name: Create Release
807852
uses: softprops/action-gh-release@v3
808853
with:
@@ -812,8 +857,8 @@ jobs:
812857
Output/OpenClawCompanion-Setup-arm64.exe
813858
OpenClawTray-${{ needs.test.outputs.semVer }}-win-x64.zip
814859
OpenClawTray-${{ needs.test.outputs.semVer }}-win-arm64.zip
815-
prerelease: ${{ contains(github.ref_name, '-') }}
816-
make_latest: ${{ contains(github.ref_name, '-') && 'false' || 'true' }}
860+
prerelease: ${{ needs.test.outputs.isPrerelease }}
861+
make_latest: ${{ needs.test.outputs.isPrerelease == 'true' && 'false' || 'true' }}
817862
body: |
818863
## OpenClaw Windows Hub ${{ github.ref_name }}
819864

‎docs/RELEASING.md‎

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,14 @@ build/sign/publish release artifacts.
2626
"MSIX distribution is paused"
2727
```
2828

29-
3. Create a new stable or prerelease tag from `origin/main`. Never move a
30-
previously published tag.
29+
3. Create a new stable, stable correction, or prerelease tag from `origin/main`.
30+
Never move a previously published tag.
3131

3232
```powershell
33-
$tag = "vX.Y.Z" # or vX.Y.Z-alpha.N for a prerelease
33+
# Stable: vX.Y.Z
34+
# Stable correction matching the OpenClaw monorepo: vX.Y.Z-N
35+
# Prerelease: vX.Y.Z-alpha.N
36+
$tag = "vX.Y.Z"
3437
if ((git rev-parse HEAD) -ne (git rev-parse origin/main)) {
3538
throw "HEAD is not origin/main; do not tag."
3639
}
@@ -65,11 +68,36 @@ build/sign/publish release artifacts.
6568

6669
## Release channel policy
6770

68-
Stable and alpha tags use the same signed CI release pipeline:
71+
Stable, stable-correction, and alpha tags use the same signed CI release pipeline:
6972

7073
- `vX.Y.Z` creates a normal release eligible to become latest.
74+
- `vX.Y.Z-N` creates a stable correction release eligible to become latest. The
75+
numeric correction suffix intentionally follows the OpenClaw monorepo release
76+
convention and is not treated as a SemVer prerelease. Only publish a
77+
correction for the current latest stable line; publishing one for an older
78+
line would incorrectly move GitHub's Latest release marker backward. CI
79+
enforces both constraints: the exact tag must already be a published stable
80+
`openclaw/openclaw` release, and it must advance the current Windows latest
81+
release under OpenClaw correction ordering.
7182
- `vX.Y.Z-alpha.N` creates a prerelease that stable updater checks do not offer.
7283

84+
Stable correction support begins only with an eligible upstream release tag
85+
created from `main` after the correction-aware implementation has landed. For
86+
this rollout, the Windows repository already contains its own annotated
87+
`v2026.7.1-2` tag, separate from the matching upstream tag, and it points to a
88+
commit that predates the implementation. It is not a correction-aware artifact
89+
and must not be moved, rebuilt from a different commit, or reused as a recovery
90+
release.
91+
92+
If the first post-merge Windows release is another numeric correction, users on
93+
the matching unsuffixed version need to install that new release manually.
94+
Older Windows clients use Updatum's default parser, which removes the numeric
95+
correction suffix before comparison. If the first post-merge release is a newer
96+
unsuffixed stable version, ordinary Updatum ordering can deliver it without the
97+
manual correction transition. Once any correction-aware Windows build is
98+
installed, later corrections and stable base versions are compared using
99+
OpenClaw release ordering.
100+
73101
```powershell
74102
git tag -a vX.Y.Z-alpha.N -m "OpenClaw Windows Hub vX.Y.Z-alpha.N"
75103
git push origin vX.Y.Z-alpha.N

‎docs/VERSIONING.md‎

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,16 @@ project files must not hardcode release versions with `<Version>` elements.
88
Canonical release tags use:
99

1010
- Stable: `vX.Y.Z`
11+
- Stable correction: `vX.Y.Z-N`, where `N` is a positive integer
1112
- Alpha: `vX.Y.Z-alpha.N`
1213

14+
Numeric correction suffixes are an intentional stable-channel exception to
15+
SemVer's usual prerelease interpretation. Corrections sort after their
16+
unsuffixed base release and then by numeric correction: `vX.Y.Z` <
17+
`vX.Y.Z-1` < `vX.Y.Z-2`. A correction tag must not be published if that exact
18+
tag already exists or a newer stable/correction release has already been
19+
published.
20+
1321
`GitVersion.yml` controls how tag history becomes SemVer. The product build
1422
imports GitVersion through `src\Directory.Build.props`, so normal `dotnet build`,
1523
`.\build.ps1`, `.\run-app-local.ps1`, and CI builds all derive assembly metadata
@@ -18,16 +26,17 @@ from the same tag history.
1826
The repository-local tool manifest (`.config\dotnet-tools.json`) and MSBuild
1927
package reference (`src\Directory.Build.props`) are the authoritative local
2028
tool/package pins and currently target GitVersion 6.8.2. The CI workflow's
21-
`gittools/actions/gitversion/setup` step currently pins `6.4.x` for workflow
22-
output computation; if workflow files are being changed, prefer aligning that
23-
setup action to `6.8.x`. Until then, CI's tag/SemVer verification remains the
24-
release-blocking guard against version drift.
29+
`gittools/actions/gitversion/setup` step tracks the matching `6.8.x` line for
30+
workflow output computation. Keep the workflow action on the same major/minor
31+
line as the repository pins so the value injected into product metadata is
32+
computed by the same GitVersion release.
2533

2634
## Tagged and untagged builds
2735

2836
Tagged releases must resolve to the exact tag SemVer:
2937

3038
- `vX.Y.Z` -> `X.Y.Z`
39+
- `vX.Y.Z-N` -> `X.Y.Z-N`
3140
- `vX.Y.Z-alpha.N` -> `X.Y.Z-alpha.N`
3241

3342
Untagged `master` checkouts are still prerelease builds. After an alpha tag,
@@ -63,17 +72,30 @@ diagnostics.
6372
## CI release flow
6473

6574
The release workflow computes GitVersion in the `test` job for workflow outputs
66-
and artifact naming. Product builds themselves also use GitVersion-backed
67-
MSBuild metadata; CI should not pass a competing hardcoded `-p:Version=...`
68-
value that could hide drift.
75+
and artifact naming. It then passes that resolved value to product builds as
76+
`Version` and `InformationalVersion`, keeping assembly metadata and artifacts on
77+
one exact identity. CI must not pass a competing hardcoded version literal that
78+
could hide drift.
79+
80+
GitVersion interprets `X.Y.Z-N` as a prerelease, so numeric stable corrections
81+
use one narrow exception: the release-version step recognizes the correction
82+
tag, validates its stable ordering with
83+
`scripts\Test-OpenClawStableCorrectionRelease.ps1`, and replaces the GitVersion
84+
workflow outputs with the exact tag-derived value before the build. The build's
85+
explicit MSBuild version properties are therefore the validated correction tag,
86+
not an independent version source. Ordinary stable, alpha, and untagged builds
87+
continue to use the GitVersion result directly.
6988

7089
Release build jobs must check out full git history (`fetch-depth: 0`) so
7190
GitVersion can see tags.
7291

73-
Tagged CI runs verify that `github.ref_name` and GitVersion's `SemVer` output
74-
match before build artifacts are published. If a release tag is
75-
`v0.6.0-alpha.5`, CI must produce `0.6.0-alpha.5`; a derived value such as
76-
`0.6.0-alpha.6` or `0.6.0-712` is a release-blocking error.
92+
Tagged CI runs verify that `github.ref_name` and the resolved release version
93+
match before build artifacts are published. For stable and alpha tags, the
94+
resolved version must equal GitVersion's `SemVer`. For numeric corrections, the
95+
resolved version must equal the validated tag even though GitVersion classifies
96+
the suffix as a prerelease. If a release tag is `v0.6.0-alpha.5`, CI must produce
97+
`0.6.0-alpha.5`; a derived value such as `0.6.0-alpha.6` or `0.6.0-712` is a
98+
release-blocking error.
7799

78100
## Local scripts
79101

@@ -99,6 +121,9 @@ For example:
99121
- Keep release tags and `GitVersion.yml` as the versioning contract.
100122
- Keep `GitVersion.yml` configured so exact alpha tags resolve to their tag
101123
SemVer, and keep CI's tag/version verification enabled.
124+
- Keep numeric correction tags behind the stable-ordering validation in both
125+
release resolution and publication; never classify every hyphenated tag as a
126+
prerelease without recognizing this exception.
102127

103128
## References
104129

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
[CmdletBinding()]
2+
param(
3+
[Parameter(Mandatory)]
4+
[ValidatePattern('^v(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)-[1-9]\d*$')]
5+
[string]$Tag,
6+
7+
[string]$GitHubToken = $env:GITHUB_TOKEN
8+
)
9+
10+
Set-StrictMode -Version Latest
11+
$ErrorActionPreference = "Stop"
12+
13+
function ConvertTo-StableReleaseVersion {
14+
param([Parameter(Mandatory)][string]$Value)
15+
16+
$match = [regex]::Match(
17+
$Value,
18+
'^v?(?<year>0|[1-9]\d*)\.(?<month>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)(?:-(?<revision>[1-9]\d*))?$')
19+
if (-not $match.Success) {
20+
throw "Stable release version '$Value' has an unsupported format."
21+
}
22+
23+
return @(
24+
[long]$match.Groups["year"].Value,
25+
[long]$match.Groups["month"].Value,
26+
[long]$match.Groups["patch"].Value,
27+
$(if ($match.Groups["revision"].Success) {
28+
[long]$match.Groups["revision"].Value
29+
} else {
30+
0L
31+
})
32+
)
33+
}
34+
35+
function Assert-NewerStableRelease {
36+
param(
37+
[Parameter(Mandatory)][string]$Candidate,
38+
[Parameter(Mandatory)][string]$Current
39+
)
40+
41+
$candidateParts = ConvertTo-StableReleaseVersion $Candidate
42+
$currentParts = ConvertTo-StableReleaseVersion $Current
43+
for ($index = 0; $index -lt $candidateParts.Count; $index++) {
44+
if ($candidateParts[$index] -gt $currentParts[$index]) {
45+
return
46+
}
47+
if ($candidateParts[$index] -lt $currentParts[$index]) {
48+
throw "Stable correction '$Candidate' does not advance current Windows release '$Current'."
49+
}
50+
}
51+
52+
throw "Stable correction '$Candidate' is already the current Windows release."
53+
}
54+
55+
$headers = @{
56+
Accept = "application/vnd.github+json"
57+
"User-Agent" = "openclaw-windows-node-release"
58+
"X-GitHub-Api-Version" = "2022-11-28"
59+
}
60+
if (-not [string]::IsNullOrWhiteSpace($GitHubToken)) {
61+
$headers.Authorization = "Bearer $GitHubToken"
62+
}
63+
64+
$upstreamRelease = Invoke-RestMethod `
65+
-Headers $headers `
66+
-Uri "https://api.github.com/repos/openclaw/openclaw/releases/tags/$Tag"
67+
if ($upstreamRelease.tag_name -cne $Tag -or
68+
$upstreamRelease.draft -or
69+
$upstreamRelease.prerelease -or
70+
$null -eq $upstreamRelease.published_at) {
71+
throw "Stable correction '$Tag' must match an exact published stable openclaw/openclaw release."
72+
}
73+
74+
$currentWindowsRelease = Invoke-RestMethod `
75+
-Headers $headers `
76+
-Uri "https://api.github.com/repos/openclaw/openclaw-windows-node/releases/latest"
77+
Assert-NewerStableRelease `
78+
-Candidate $Tag `
79+
-Current $currentWindowsRelease.tag_name
80+
81+
$parsedTag = ConvertTo-StableReleaseVersion $Tag
82+
[pscustomobject]@{
83+
Tag = $Tag
84+
BaseVersion = "$($parsedTag[0]).$($parsedTag[1]).$($parsedTag[2])"
85+
CurrentWindowsTag = $currentWindowsRelease.tag_name
86+
}

‎scripts/build-inno-local.ps1‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ function Publish-ArchitecturePayload {
109109
)
110110
if ($PublishVersion) {
111111
$trayPublishArgs += "-p:Version=$PublishVersion"
112+
$trayPublishArgs += "-p:InformationalVersion=$PublishVersion"
112113
}
113114

114115
dotnet publish @trayPublishArgs

0 commit comments

Comments
 (0)