Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 38 additions & 4 deletions .github/workflows/release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Ignore the expected delete-asset miss on reruns

When the workflow is re-run after this step has already renamed the assets, the raw PasClaw-$arch.exe asset no longer exists, and gh release delete-asset treats that as an error; redirecting stderr does not reset $LASTEXITCODE. In this checked shell: pwsh workflow, GitHub Actions appends exit $LASTEXITCODE, so a successful portable --clobber upload followed by this expected miss still makes the step fail, breaking the advertised re-run fallback path. Query before deleting or explicitly clear/ignore the exit code for the expected not-found case.

Useful? React with 👍 / 👎.

}
}

# --- 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).
Expand Down
7 changes: 7 additions & 0 deletions installer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-<version>-x64-setup.exe` /
`PasClaw-<version>-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-<version>-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)

Expand Down
Loading