ci: prune old desktop build artifacts from the release staging dir #18

Open
mohlec wants to merge 1 commit from ci/prune-desktop-artifacts into slash/main
Owner

Closes the rotation gap found while tracing where build output is stashed (slash-deploy#34).

The gap

Save artifacts copies every .deb, .tar.gz and .AppImage into
/var/lib/forgejo/data/plugin-releases and never removes anything. The release-asset side of
this same workflow is already pruned — it deletes the previous platform assets before attaching
new ones — so only the on-disk staging copy was unbounded. It had reached 74 artifacts across 15
builds
.

That volume is 78% full and backed by an all-HDD Ceph cluster shared with CT#137
ncw-chat
, so this is not just tidiness.

Why prune by build tag, not by file count

build-android.yml prunes with ls -t | tail -n +6 because it emits exactly one APK per build.
This workflow emits several files per build — deb + tar.gz + AppImage — and the windows/macos jobs
attach their own to the same tag. A file-count prune would delete the current build's siblings.
So this groups by the slash-desktop-<date>-<commit> tag and keeps the newest 3 builds whole.

Validated as a dry run against the real directory

Nothing was deleted; the logic was run read-only first:

Distinct builds present 15
Kept newest 3
Pruned 12 builds / 65 files / 5.7 GB
Kept vs pruned sets disjoint — no collision
Non-desktop files in that dir 20, none matched by the glob

That 5.7 GB also corrects a figure I gave earlier — I had estimated ~9 GB from file count times
AppImage size, which double-counted; the real reclaimable total keeping 3 builds is 5.7 GB. The
in-file comment carries the corrected number.

One thing this does not do

The prune only runs on the next desktop build, and the most recent was 2026-07-16 — six
weeks ago. So merging this does not reclaim the existing 5.7 GB; that needs a one-time manual
prune, which I have not run.

Closes the rotation gap found while tracing where build output is stashed (slash-deploy#34). ### The gap `Save artifacts` copies every `.deb`, `.tar.gz` and `.AppImage` into `/var/lib/forgejo/data/plugin-releases` and **never removes anything**. The release-asset side of this same workflow is already pruned — it deletes the previous platform assets before attaching new ones — so only the on-disk staging copy was unbounded. It had reached **74 artifacts across 15 builds**. That volume is **78% full** and backed by an **all-HDD Ceph cluster shared with CT#137 `ncw-chat`**, so this is not just tidiness. ### Why prune by build tag, not by file count `build-android.yml` prunes with `ls -t | tail -n +6` because it emits exactly one APK per build. This workflow emits several files per build — deb + tar.gz + AppImage — and the windows/macos jobs attach their own to the *same* tag. A file-count prune would delete the current build's siblings. So this groups by the `slash-desktop-<date>-<commit>` tag and keeps the newest 3 builds whole. ### Validated as a dry run against the real directory Nothing was deleted; the logic was run read-only first: | | | |---|---| | Distinct builds present | 15 | | Kept | newest 3 | | Pruned | 12 builds / 65 files / **5.7 GB** | | Kept vs pruned sets | disjoint — no collision | | Non-desktop files in that dir | 20, none matched by the glob | That 5.7 GB also **corrects a figure I gave earlier** — I had estimated ~9 GB from file count times AppImage size, which double-counted; the real reclaimable total keeping 3 builds is 5.7 GB. The in-file comment carries the corrected number. ### One thing this does not do The prune only runs on the **next desktop build**, and the most recent was **2026-07-16** — six weeks ago. So merging this does not reclaim the existing 5.7 GB; that needs a one-time manual prune, which I have not run.
ci: prune old desktop build artifacts from the release staging dir
Some checks failed
Build Slash Desktop / build-windows (pull_request) Failing after 0s
Build Slash Desktop / build-linux (pull_request) Successful in 6m16s
Build Slash Desktop / build-macos (pull_request) Failing after 11m5s
ec8c9fc846
The Save artifacts step copies every deb, tar.gz and AppImage into
/var/lib/forgejo/data/plugin-releases and never removes anything, so the
directory had accumulated 74 desktop artifacts across 15 builds. The
release-asset side of this workflow is already pruned (it deletes the
previous platform assets before attaching new ones); only the on-disk
staging copy was unbounded.

That volume is 78% full and backed by an all-HDD Ceph cluster shared with
CT#137 ncw-chat, so reclaiming it matters beyond tidiness - see
slash-deploy#34.

Prunes by build tag rather than by file count. build-android.yml can count
files because it emits exactly one APK per build; this workflow emits
several per build (deb + tar.gz + AppImage, and the windows/macos jobs
attach their own to the same tag), so a file-count prune would delete the
current build's siblings.

Keeps the newest 3 builds. Validated as a dry run against the real
directory: 15 distinct builds, keeps 3, prunes 12 builds / 65 files /
5.7 GB, kept and pruned sets disjoint, and the 20 non-desktop files in that
directory are not matched by the glob.

Note this only takes effect on the next desktop build, and the most recent
one was 2026-07-16 - the existing 5.7 GB needs a one-time manual prune.
Some checks failed
Build Slash Desktop / build-windows (pull_request) Failing after 0s
Build Slash Desktop / build-linux (pull_request) Successful in 6m16s
Build Slash Desktop / build-macos (pull_request) Failing after 11m5s
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin ci/prune-desktop-artifacts:ci/prune-desktop-artifacts
git switch ci/prune-desktop-artifacts

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch slash/main
git merge --no-ff ci/prune-desktop-artifacts
git switch ci/prune-desktop-artifacts
git rebase slash/main
git switch slash/main
git merge --ff-only ci/prune-desktop-artifacts
git switch ci/prune-desktop-artifacts
git rebase slash/main
git switch slash/main
git merge --no-ff ci/prune-desktop-artifacts
git switch slash/main
git merge --squash ci/prune-desktop-artifacts
git switch slash/main
git merge --ff-only ci/prune-desktop-artifacts
git switch slash/main
git merge ci/prune-desktop-artifacts
git push origin slash/main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
slash/slash-desktop!18
No description provided.