[eric] win: upload stable-named OpenSwarm-Setup-x64.exe alias so site link stops 404ing

This commit is contained in:
ciregenz
2026-05-25 14:01:01 -07:00
parent 43d0a50c1d
commit 20ff15e6a0
+24
View File
@@ -426,6 +426,30 @@ try {
Remove-Item -Recurse -Force $Staging -ErrorAction SilentlyContinue
# --- Step 5b: Stable-named installer alias for the website download button ---
# electron-builder's Squirrel target ignores `artifactName`, so the installer
# ships as `openswarm-Setup-<version>.exe` (lowercase, version-stamped). The
# openswarm.com Windows button links to a fixed name, so without this alias
# every release 404s. The DMG target DOES honor artifactName, which is why
# macOS never hit this. The alias is a byte copy of the already-signed
# installer (signature preserved) and is invisible to the Squirrel updater,
# which keys off RELEASES + .nupkg, not the installer filename.
if ($Publish) {
Write-Host "[5b/5] Uploading stable-named installer alias (OpenSwarm-Setup-x64.exe)..."
$version = (Get-Content -Raw (Join-Path $ProjectRoot 'electron\package.json') | ConvertFrom-Json).version
$DistDir = Join-Path $ProjectRoot 'electron\dist'
$SetupExe = Get-ChildItem -Path $DistDir -Filter '*Setup*.exe' -ErrorAction SilentlyContinue | Select-Object -First 1
if (-not $SetupExe) { throw "No Squirrel Setup .exe found in $DistDir to alias" }
if (-not (Get-Command gh -ErrorAction SilentlyContinue)) {
throw "gh CLI not found; cannot upload OpenSwarm-Setup-x64.exe alias (install gh or upload it manually)"
}
$AliasExe = Join-Path $DistDir 'OpenSwarm-Setup-x64.exe'
Copy-Item -Force $SetupExe.FullName $AliasExe
& gh release upload "v$version" $AliasExe --repo openswarm-ai/openswarm --clobber
if ($LASTEXITCODE -ne 0) { throw "gh release upload of OpenSwarm-Setup-x64.exe failed" }
Write-Host "Uploaded OpenSwarm-Setup-x64.exe to release v$version."
}
Write-Host ""
Write-Host "========================================"
Write-Host " Build Complete!"