fix(release): upload Linux AppImage under feed x64 name

Prevent stale TTRPGPlayer-x64.AppImage on the updates host when
electron-builder leaves an x86_64 alias beside an older x64 file.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ivan Fontosh
2026-08-08 18:47:20 +08:00
parent 1fbaaa6e77
commit 1d94c95cc8
3 changed files with 81 additions and 28 deletions
+20 -3
View File
@@ -367,20 +367,37 @@ function Copy-ReleaseArtifacts {
$copied = 0
foreach ($name in ($names | Sort-Object)) {
# Always publish Linux AppImage under feed/site name (x64), never leave x86_64 alias.
if ($name -match 'x86_64' -and $name -match '\.AppImage$') {
$canonical = $name -replace 'x86_64', 'x64'
if ($names.Contains($canonical)) {
continue
}
$name = $canonical
}
$src = Join-Path $BuildReleaseDir $name
$destName = $name
if (-not (Test-Path -LiteralPath $src)) {
if ($name -match 'x64' -and $name -notmatch 'x86_64') {
$alt = $name -replace 'x64', 'x86_64'
$src = Join-Path $BuildReleaseDir $alt
$altPath = Join-Path $BuildReleaseDir $alt
if (Test-Path -LiteralPath $altPath) {
$src = $altPath
}
}
}
if (-not (Test-Path -LiteralPath $src)) {
Write-Host " [--] skip (not built): $name" -ForegroundColor Yellow
continue
}
$dest = Join-Path $TargetDir ([System.IO.Path]::GetFileName($src))
$dest = Join-Path $TargetDir $destName
Copy-Item -LiteralPath $src -Destination $dest -Force
Write-Ok "copied $([System.IO.Path]::GetFileName($src))"
if ([System.IO.Path]::GetFileName($src) -ne $destName) {
Write-Ok "copied $([System.IO.Path]::GetFileName($src)) -> $destName"
} else {
Write-Ok "copied $destName"
}
$copied += 1
}