Skip to content

fix(ci): reliable CLI→PyPI publishing — stable-only gate + stop desktop deleting CLI assets#6433

Merged
houko merged 4 commits into
mainfrom
fix/cli-pypi-stable-only
Jul 10, 2026
Merged

fix(ci): reliable CLI→PyPI publishing — stable-only gate + stop desktop deleting CLI assets#6433
houko merged 4 commits into
mainfrom
fix/cli-pypi-stable-only

Conversation

@houko

@houko houko commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Two related fixes to the CLI → PyPI release path, both surfaced by the v2026.7.10 release whose CLI / PyPI job failed.

1. Gate cli_pypi to stable/LTS tags only

The v2026.7.10 CLI / PyPI job first failed with:

400 Project size too large. Limit for project 'librefang' total size is 10 GB.

The librefang PyPI project has a 10 GB total-size quota. Each release uploads ~8 per-platform CLI binary wheels (~250 MB) via cargo xtask publish-pypi-binaries. Because cli_pypi ran on every v* tag — including beta/rc pre-releases — 46 accumulated pre-releases consumed 10.35 GB and pushed the project over quota (measured: 48 versions / 10.73 GB, of which 46 pre-releases were 10.35 GB).

Gate cli_pypi to stable and LTS tags only, in both release.yml (tag-push pipeline) and release-cli.yml (manual re-run path).

Tag contains - endsWith -lts Publishes
v2026.7.10 (stable) no yes
v2026.6.26-beta.24 yes no no
v2026.5.8-rc.1 yes no no
v2026.3.0-lts yes yes yes

Pre-release CLI binaries stay on the GitHub Release; librefang-sdk (separate PyPI project) is untouched.

2. Stop desktop re-release from deleting CLI binary assets

After the PyPI quota was freed, CLI / PyPI kept failing — now with a 404 downloading librefang-x86_64-apple-darwin.tar.gz. Root cause: the desktop job's "Delete existing assets for this target" step matched *<rust_target>*, and the cli_* jobs name their uploads librefang-<rust_target>.tar.gz (+ .sha256) with the same target triple. So when a desktop job re-ran after its CLI counterpart had already uploaded — exactly what the macOS desktop jobs do when they re-run for notarization — it deleted the CLI mac tarballs as collateral, and cli_pypi then 404'd downloading them to build the wheels.

Skip CLI-owned assets (librefang-*, SHA256SUMS*) before the target-glob delete. Desktop bundles use Tauri's own LibreFang_<ver>_<x64|aarch64|amd64|arm64>… naming, which never contains the triple, so the guard costs the desktop nothing and protects the CLI artifacts on every platform.

Verification

  • Both workflow files parse (python3 -c "import yaml; ...").
  • Gate expression hand-evaluated against the four tag shapes (table above).
  • Grep confirms release.yml + release-cli.yml are the only two workflows publishing CLI wheels to PyPI; no third site.
  • Delete-glob collateral confirmed against the live run: the v2026.7.10 macOS CLI tarballs were present after cli_mac, absent after the macOS desktop jobs re-ran, and cli_pypi 404'd on them.

Out of scope (separate follow-up)

  • The 46 pre-releases already on PyPI were the cause of fix Bump docker/build-push-action from 6 to 7 #1's symptom; they have been deleted out-of-band (PyPI has no delete API) to bring the project to 0.38 GB.
  • v2026.7.10's CLI wheels are not on PyPI (its cli_pypi never completed). With this merged, the next stable release publishes them cleanly.

The `librefang` PyPI project has a 10 GB total-size quota.
Each release uploads ~8 per-platform CLI binary wheels (~250 MB), and because every beta/rc tag published too, 46 accumulated pre-releases consumed 10.35 GB and pushed the project over quota — the v2026.7.10 stable `CLI / PyPI` job then failed with `400 Project size too large`.

Gate the `cli_pypi` job (in both release.yml and the manual release-cli.yml re-run path) to stable and LTS tags only.
A tag is treated as a pre-release when it carries any `-suffix` (e.g. `-beta.10`, `-rc.1`); `-lts` is the sole non-pre-release suffix, matching create_release's existing `-lts` special-casing.
Pre-release CLI binaries are still attached to the GitHub Release, and `librefang-sdk` (a separate PyPI project) is unaffected.
@github-actions github-actions Bot added no-rust-required This task does not require Rust knowledge size/S 10-49 lines changed area/ci CI/CD and build tooling labels Jul 10, 2026
Rewrap the new cli_pypi guard comments in release.yml and
release-cli.yml to one sentence per line, per CLAUDE.md's
prose-wrapping rule (new prose must break only at sentence
boundaries, not at a fixed column width) — the same fix #6418
applied to a similar release-workflow comment.

Add the missing [Unreleased] CHANGELOG entry for this fix, matching
the established convention of every other CI-only fix PR in this
repo (#6410, #6389, #6416, #6418) recording a changelog line.
@github-actions github-actions Bot added the area/docs Documentation and guides label Jul 10, 2026
Evan added 2 commits July 10, 2026 22:05
The desktop job's "Delete existing assets for this target" step matched `*<rust_target>*`, and the cli_* jobs name their uploads `librefang-<rust_target>.tar.gz|.zip` (+ `.sha256`) with the SAME target triple.
So when a desktop job re-ran after its CLI counterpart had already uploaded, it deleted the CLI binary tarball as collateral.
This is why the v2026.7.10 macOS CLI tarballs (`librefang-x86_64-apple-darwin.tar.gz`, `librefang-aarch64-apple-darwin.tar.gz`) disappeared after the desktop macOS jobs re-ran for notarization, which then made the `CLI / PyPI` job fail with a 404 when it tried to download them to build the wheels.

Skip CLI-owned assets (`librefang-*`, `SHA256SUMS*`) before the target-glob delete.
Desktop bundles use Tauri's own naming (`LibreFang_<ver>_<x64|aarch64|amd64|arm64>…`) which never contains the triple, so the guard costs the desktop nothing while protecting the CLI artifacts on every platform.
@houko houko changed the title fix(ci): publish CLI wheels to PyPI only for stable/LTS releases fix(ci): reliable CLI→PyPI publishing — stable-only gate + stop desktop deleting CLI assets Jul 10, 2026
@houko
houko merged commit a41e64c into main Jul 10, 2026
33 checks passed
@houko
houko deleted the fix/cli-pypi-stable-only branch July 10, 2026 13:24
This was referenced Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci CI/CD and build tooling area/docs Documentation and guides no-rust-required This task does not require Rust knowledge size/S 10-49 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants