Skip to content

ci(release): stop the rolling release collecting a .deb per version - #296

Merged
d4vid87 merged 1 commit into
mainfrom
ci/prune-stale-release-assets
Sep 3, 2026
Merged

ci(release): stop the rolling release collecting a .deb per version#296
d4vid87 merged 1 commit into
mainfrom
ci/prune-stale-release-assets

Conversation

@d4vid87

@d4vid87 d4vid87 commented Sep 3, 2026

Copy link
Copy Markdown
Owner

What the rolling release actually holds

Eighteen assets, six of which are the current build:

hookecho_0.8.0-1_amd64.deb            2026-08-12
hookecho_0.9.0-1_amd64.deb            2026-08-14
hookecho_0.10.0-1_amd64.deb           2026-08-25
hookecho_0.11.0-1_amd64.deb           2026-08-25
hookecho_0.12.0.alpha.1-1_amd64.deb   2026-08-26
hookecho_0.12.0.beta.1-1_amd64.deb    2026-08-31
hookecho_0.12.0.beta.2-1_amd64.deb    2026-09-03
Hook_Echo-WX-arm64-v8a.apk            2026-08-26   ← the old product name
Hook_Echo-WX-macos.zip                2026-08-26
Hook_Echo-WX-setup-x86_64.exe         2026-08-26
Hook_Echo-WX-x86_64.AppImage          2026-08-26
Hook_Echo-WX-x86_64.msi               2026-08-26

It is described as "rolling build of main — rebuilt and re-published on every push, so this is always the newest code". Someone landing there gets a .deb picker spanning four weeks and five files named after an app this is not called any more.

Why

--clobber and action-gh-release both replace an asset by name, and cargo-deb puts the version in the filename. Every other platform emits a fixed name and has been overwriting itself correctly all along; the .deb is the only one that could not.

Fix

A stable name for the rolling copy. The build makes a second copy at dist/rolling/HookEcho-amd64.deb, and the rolling release uploads that. It is deliberately outside dist/, so the tagged upload's dist/*.deb still means exactly one versioned file — a tag is a version, and its assets should say so.

A prune step for what has already accumulated, matching two patterns and nothing else:

  • hookecho_<version>_amd64.deb — the versioned debs, now superseded
  • Hook_Echo-WX-* — the old product name, last built 2026-08-26

Deliberately narrow rather than "delete anything not in the current set": the four platform jobs upload into latest in parallel, so a set-based prune would race them and delete a build that had landed seconds earlier. These two patterns cannot match a live asset.

Verification

The patterns were run against the live release:

$ gh release view latest --json assets -q '.assets[].name' | grep -E '…' | wc -l
12
$ gh release view latest --json assets -q '.assets[].name' | grep -vE '…'
HookEcho-arm64-v8a.apk
HookEcho-macos.zip
HookEcho-setup-x86_64.exe
hookecho-windows-x86_64.zip
HookEcho-x86_64.AppImage
HookEcho-x86_64.msi

12 matched, and exactly the six current assets survive. python3 -c "import yaml; yaml.safe_load(...)" parses the workflow.

The prune runs after the upload in the same job, so the newly uploaded HookEcho-amd64.deb is in place before the versioned one it replaces is removed.

🤖 Generated with Claude Code

The rolling release held eighteen assets: seven .debs going back to 0.8.0 and
five under the old product name, against six current builds. `--clobber` and
`action-gh-release` replace an asset by name, and `cargo-deb` puts the version
in the filename, so the .deb was the only artifact that could not overwrite
itself.

The rolling release now uploads a second copy under a fixed name, kept outside
`dist/` so the tagged upload's `dist/*.deb` still means exactly one versioned
file — a tag is a version and its assets should say so. A prune step clears what
has already piled up, matching only the versioned debs and the old product name.

Narrow on purpose: the four platform jobs upload into `latest` in parallel, so
deleting anything outside a current set would race them.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@d4vid87
d4vid87 merged commit 372e151 into main Sep 3, 2026
6 checks passed
@d4vid87
d4vid87 deleted the ci/prune-stale-release-assets branch September 3, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant