feat(ci): prune release assets outside the newest two tags (#52) #70

Merged
archvillainette merged 1 commits from feat/prune-release-assets into main 2026-07-29 08:51:25 +00:00
Owner

Closes #52.

Adds scripts/prune-release-assets.sh and a best-effort step at the end of build-binaries.yml.

  • Lists every release page, sorts by creation date, skips the newest two published releases, deletes the rest's attachments via DELETE /releases/{id}/assets/{asset_id}.
  • Drafts never consume a keep slot, so a draft cannot strip the newest real release.
  • Releases, tags, source archives and release notes are never touched.
  • Nothing is excluded: SHA256SUMS and the wrappers go with the binaries. Checksums are only meaningful next to the files they cover, and the consumer drift-check reads the wrappers from the latest release, which stays complete.
  • Failures warn and the step has continue-on-error: true — a stale asset is cheaper than a blocked publish.

tests/prune-release-assets.sh drives the script with a stub curl: keep window, out-of-order responses, drafts, no non-asset DELETE, short-page pagination stop, and both failure paths. Wired into make check.

v0.2.0 still needs its 9 assets cleared by hand in the web UI, as the issue notes.

🤖 Generated with Claude Code

Closes #52. Adds `scripts/prune-release-assets.sh` and a best-effort step at the end of `build-binaries.yml`. - Lists every release page, sorts by creation date, skips the newest two published releases, deletes the rest's attachments via `DELETE /releases/{id}/assets/{asset_id}`. - Drafts never consume a keep slot, so a draft cannot strip the newest real release. - Releases, tags, source archives and release notes are never touched. - Nothing is excluded: SHA256SUMS and the wrappers go with the binaries. Checksums are only meaningful next to the files they cover, and the consumer drift-check reads the wrappers from the latest release, which stays complete. - Failures warn and the step has `continue-on-error: true` — a stale asset is cheaper than a blocked publish. `tests/prune-release-assets.sh` drives the script with a stub `curl`: keep window, out-of-order responses, drafts, no non-asset DELETE, short-page pagination stop, and both failure paths. Wired into `make check`. v0.2.0 still needs its 9 assets cleared by hand in the web UI, as the issue notes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
archvillainette added 1 commit 2026-07-29 07:51:21 +00:00
Gitea has no release-asset retention, so every v* tag kept its full
cross-platform binary set forever — 31 tags had accumulated 1.8 GB on the
production host disk. Nothing consumes an old asset: CI takes the Crucible
binary from the Nix flake, and every deleted file is reproducible from its tag.

scripts/prune-release-assets.sh lists every release page, sorts by creation
date, skips the newest two published releases, and deletes the remaining
releases' attachments. Two rather than one so a release in flight never leaves
the previous download broken. Drafts never consume a keep slot. Releases, tags,
source archives and release notes are untouched.

Nothing is excluded — SHA256SUMS and the wrappers go with the binaries: the
checksums are only meaningful next to the files they cover, and the consumer
drift-check reads the wrappers from the latest release, which stays complete.

The step is best-effort: a stale asset is cheaper than a blocked publish, so
API failures warn and the step carries continue-on-error.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
archvillainette scheduled this pull request to auto merge when all checks succeed 2026-07-29 07:54:40 +00:00
xtul approved these changes 2026-07-29 08:51:23 +00:00
archvillainette merged commit 4d03085996 into main 2026-07-29 08:51:25 +00:00
archvillainette deleted branch feat/prune-release-assets 2026-07-29 08:51:25 +00:00
Sign in to join this conversation.