4040 if ($env:RELEASE_TAG -notmatch '^v[0-9]{4}\.[1-9][0-9]*\.[1-9][0-9]*((-(alpha|beta)\.[1-9][0-9]*)|(-[1-9][0-9]*))?$') {
4141 throw "Invalid OpenClaw release tag: $env:RELEASE_TAG"
4242 }
43+ $stableRelease = -not (
44+ $env:RELEASE_TAG.Contains("-alpha.") -or
45+ $env:RELEASE_TAG.Contains("-beta.")
46+ )
4347 if ($env:WINDOWS_NODE_TAG -notmatch '^v[0-9]+\.[0-9]+\.[0-9]+([-.][0-9A-Za-z]+([.-][0-9A-Za-z]+)*)?$') {
4448 throw "windows_node_tag must be an explicit openclaw-windows-node release tag, not latest: $env:WINDOWS_NODE_TAG"
4549 }
5458 "OpenClawCompanion-Setup-x64.exe",
5559 "OpenClawCompanion-Setup-arm64.exe"
5660 )
61+ $allowedTargetCompanionAssetNames = @(
62+ $requiredInstallerNames
63+ "OpenClawCompanion-SHA256SUMS.txt"
64+ )
5765 if ($expectedDigests.Count -ne $requiredInstallerNames.Count) {
5866 throw "expected_installer_digests must contain exactly the current installer asset contract."
5967 }
@@ -64,10 +72,22 @@ jobs:
6472 }
6573 }
6674
67- $targetRelease = gh release view $env:RELEASE_TAG --repo $env:GITHUB_REPOSITORY --json tagName,isDraft,isPrerelease,url | ConvertFrom-Json
75+ $targetRelease = gh release view $env:RELEASE_TAG --repo $env:GITHUB_REPOSITORY --json tagName,isDraft,isPrerelease,assets, url | ConvertFrom-Json
6876 if ($targetRelease.tagName -ne $env:RELEASE_TAG) {
6977 throw "OpenClaw release tag mismatch: expected $env:RELEASE_TAG, got $($targetRelease.tagName)"
7078 }
79+ $unexpectedTargetCompanionAssets = @(
80+ $targetRelease.assets |
81+ Where-Object {
82+ $_.name.StartsWith("OpenClawCompanion-") -and
83+ $_.name -notin $allowedTargetCompanionAssetNames
84+ } |
85+ ForEach-Object name |
86+ Sort-Object
87+ )
88+ if ($unexpectedTargetCompanionAssets.Count -ne 0) {
89+ throw "Target OpenClaw release contains unexpected OpenClawCompanion assets before upload: $($unexpectedTargetCompanionAssets -join ', ')"
90+ }
7191
7292 $sourceRelease = gh release view $env:WINDOWS_NODE_TAG --repo openclaw/openclaw-windows-node --json tagName,isDraft,isPrerelease,url | ConvertFrom-Json
7393 if ($sourceRelease.tagName -ne $env:WINDOWS_NODE_TAG) {
7696 if ($sourceRelease.isDraft) {
7797 throw "Windows source release must be published: $($sourceRelease.url)"
7898 }
79- if (-not $targetRelease.isPrerelease -and $sourceRelease.isPrerelease) {
99+ if ($stableRelease -and $sourceRelease.isPrerelease) {
80100 throw "Stable OpenClaw releases require a non-prerelease Windows source release: $($sourceRelease.url)"
81101 }
82102
0 commit comments