From 20ff15e6a08f028dcf3f4c4a7c733b73d9fdcf56 Mon Sep 17 00:00:00 2001 From: ciregenz Date: Mon, 25 May 2026 14:01:01 -0700 Subject: [PATCH] [eric] win: upload stable-named OpenSwarm-Setup-x64.exe alias so site link stops 404ing --- scripts/build-app-win.ps1 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/scripts/build-app-win.ps1 b/scripts/build-app-win.ps1 index 3273040d..79b6fa21 100644 --- a/scripts/build-app-win.ps1 +++ b/scripts/build-app-win.ps1 @@ -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-.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!"