Skip to content

ci(release): match Homebrew class_s casing for versioned tap formula#6418

Merged
houko merged 3 commits into
mainfrom
ci/fix-versioned-formula-class
Jul 9, 2026
Merged

ci(release): match Homebrew class_s casing for versioned tap formula#6418
houko merged 3 commits into
mainfrom
ci/fix-versioned-formula-class

Conversation

@houko

@houko houko commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What

Follow-up to #6416, found by verifying what the tap sync will generate on the next release.

#6416 fixed the versioned tap formula's class name from LibrefangAT2026629-beta14 (a - left in → Ruby syntax error) to LibrefangAT2026629beta14 via tr -cd '[:alnum:]'. That removed the syntax error but kept the channel word lowercase. Homebrew's golden_gate audit requires the class name to equal Formulary.class_s of the formula name, which uppercases the char after each separator — so it expects LibrefangAT2026629Beta14. The next pre-release tag would therefore have produced a versioned formula that fails brew readall / install.

Change

  • Derive the versioned-formula class suffix with a class_s-equivalent transform (drop each separator and uppercase the following char) instead of tr -cd '[:alnum:]':

    CLASS_SUFFIX=$(printf '%s' "$SEMVER" | perl -pe 's/[-._]([[:alnum:]])/\U$1/g; s/[-._]//g')

    perl is portable (present on both ubuntu-latest and macOS), so this is also locally verifiable, unlike the GNU-only sed \u.

Verification

Ran the real sync_homebrew / sync_homebrew_cask generation steps (extracted from this branch's release.yml) against stub release metadata, with a GNU-sed shim mirroring the ubuntu-latest runner, for two tags:

  • v2026.7.10 (stable): Formula = librefang-beta, librefang-rc, [email protected] (no bare stable formula — that lives in homebrew-core now); Casks = stable + beta + rc + versioned.
  • v2026.7.10-beta.1 (beta): versioned formula class = class LibrefangAT2026710Beta1 (was ...beta1).

brew readall librefang/tap0 errors for both scenarios (matches the authoritative Formulary.class_s output).

The 40 already-published versioned formulae fixed in librefang/homebrew-tap#6 already use this class_s casing, so the tap and the generator now agree.

Follow-up to #6416. The versioned formula class name was derived with `tr -cd '[:alnum:]'`, which fixed the earlier hyphen syntax error but kept the channel word lowercase (`LibrefangAT2026710beta1`). Homebrew's golden_gate audit requires the class name to equal `Formulary.class_s` of the formula name, i.e. the char after each separator is uppercased (`LibrefangAT2026710Beta1`), so the next pre-release tag would have produced a versioned formula that fails `brew readall` / install.

Derive the suffix with a class_s-equivalent transform (drop each separator and uppercase the following char).

Verified by running the real generation step for `v2026.7.10` and `v2026.7.10-beta.1` (with a GNU-sed shim mirroring the ubuntu-latest runner): both taps now pass `brew readall` with zero errors, and the beta versioned formula is `class LibrefangAT2026710Beta1`.
@github-actions github-actions Bot added no-rust-required This task does not require Rust knowledge size/S 10-49 lines changed labels Jul 9, 2026
@github-actions github-actions Bot added area/ci CI/CD and build tooling area/docs Documentation and guides labels Jul 9, 2026
…er line

CLAUDE.md's prose-wrapping rule requires new comment prose to break
only at sentence boundaries, not at a column width.
@houko
houko merged commit 95c08eb into main Jul 9, 2026
31 checks passed
@houko
houko deleted the ci/fix-versioned-formula-class branch July 9, 2026 05:27
houko pushed a commit that referenced this pull request 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.
houko added a commit that referenced this pull request Jul 10, 2026
…op deleting CLI assets (#6433)

* fix(ci): publish CLI wheels to PyPI only for stable/LTS releases

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.

* docs(ci): rewrap cli_pypi gate comments and add CHANGELOG entry

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.

* fix(ci): stop desktop re-release from deleting CLI binary assets

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.

* docs(changelog): note the desktop asset-cleanup fix (#6433)

---------

Co-authored-by: Evan <[email protected]>
Co-authored-by: Claude <[email protected]>
@houko houko mentioned this pull request 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