From f148026dc3c37b524f22f6a19583233f93b1acc2 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 17 Jul 2026 14:03:25 +0000 Subject: [PATCH] ci: publish the self-contained exe as a portable download, drop raw input After building the installers, re-publish the Delphi exe as PasClaw---portable.exe and delete the raw PasClaw-.exe upload name, so the finished release lists intentional downloads (setup + portable) instead of the CI input binary. The download step now falls back to the portable asset when the raw name is absent, so re-running the packaging workflow still works after the rename. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01LGQKz579j1ZnDRwmr6h1V6 --- .github/workflows/release-artifacts.yml | 42 ++++++++++++++++++++++--- installer/README.md | 7 +++++ 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml index 9b72711b..70c9fd00 100644 --- a/.github/workflows/release-artifacts.yml +++ b/.github/workflows/release-artifacts.yml @@ -67,11 +67,23 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | + $tag = '${{ needs.meta.outputs.tag }}' + $ver = '${{ needs.meta.outputs.version }}' New-Item -ItemType Directory -Force bin | Out-Null - foreach ($a in @('PasClaw-x64.exe','PasClaw-x86.exe')) { - gh release download '${{ needs.meta.outputs.tag }}' -p $a -D bin - if (Test-Path "bin/$a") { Write-Host "got $a" } - else { Write-Host "::warning::$a is not attached to the release -- skipping that arch" } + # For each arch: prefer the raw upload name you attach (PasClaw-x64.exe), + # but fall back to a previously-published portable asset so a re-run + # still works after this job renamed the raw input away. + foreach ($arch in @('x64','x86')) { + $input = "PasClaw-$arch.exe" + $portable = "PasClaw-$ver-$arch-portable.exe" + $local = "bin/PasClaw-$arch.exe" + gh release download $tag -p $input -D bin 2>$null + if (-not (Test-Path $local)) { + gh release download $tag -p $portable -D bin 2>$null + if (Test-Path "bin/$portable") { Move-Item "bin/$portable" $local } + } + if (Test-Path $local) { Write-Host "got $arch" } + else { Write-Host "::warning::no $arch binary attached (PasClaw-$arch.exe) -- skipping that arch" } } if (-not (Test-Path bin\PasClaw-x64.exe) -and -not (Test-Path bin\PasClaw-x86.exe)) { throw "neither PasClaw-x64.exe nor PasClaw-x86.exe was attached to the release" @@ -105,6 +117,28 @@ jobs: if ($files) { gh release upload '${{ needs.meta.outputs.tag }}' @files --clobber } else { throw "no installers were produced" } + - name: Publish the self-contained exe as a portable download + shell: pwsh + env: + GH_TOKEN: ${{ github.token }} + run: | + # The Delphi build is self-contained, so the raw exe is a working + # no-installer PasClaw. Re-publish it under a clear, versioned name and + # remove the raw upload name so the release lists intentional downloads + # (setup + portable) rather than the CI input. + $tag = '${{ needs.meta.outputs.tag }}' + $ver = '${{ needs.meta.outputs.version }}' + foreach ($arch in @('x64','x86')) { + $local = "bin/PasClaw-$arch.exe" + $portable = "PasClaw-$ver-$arch-portable.exe" + if (Test-Path $local) { + Copy-Item $local $portable -Force + gh release upload $tag $portable --clobber + # Drop the raw input name (ignore if it wasn't attached, e.g. a re-run). + gh release delete-asset $tag "PasClaw-$arch.exe" --yes 2>$null + } + } + # --- Linux: compile with FPC and ship a self-contained tarball ------------ # Runs inside debian:bookworm because that is the exact apt package layout # the Makefile targets (same environment as docker/Dockerfile's builder). diff --git a/installer/README.md b/installer/README.md index 533ac781..faa3349e 100644 --- a/installer/README.md +++ b/installer/README.md @@ -80,6 +80,13 @@ and CI turns those exes into the two setup installers. Inno Setup via Chocolatey, runs `iscc` with the matching `/DArch` + version, and uploads `PasClaw--x64-setup.exe` / `PasClaw--x86-setup.exe` back to the same release. +4. Because the Delphi build is self-contained, the same exe is also a working + no-installer binary. The job re-publishes it as + `PasClaw--x64-portable.exe` (and `-x86-`) and **removes the raw + `PasClaw-x64.exe` / `PasClaw-x86.exe` upload name**, so the finished release + lists intentional downloads (setup + portable) instead of the CI input. A + re-run can still find the binary — it falls back to the portable asset when + the raw name is gone. ### Linux tarballs (fully in CI)