ci: automate version bumps via cargo-release + auto-render Homebrew formula#162
Merged
Conversation
`cargo release` defaults to bumping all workspace members. xtask is internal build infrastructure (publish = false), not a shipped artifact — its version doesn't track eksup's. `[package.metadata.release]` with `release = false` excludes it from the workspace bump. Without this, `cargo release minor --execute` would push tags for both eksup AND xtask (v0.1.0 → v0.1.1), cluttering the release timeline. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two cleanups from code review: - Merge build-linux + build-macos into a single build-unix job with a 4-entry matrix (2 linux targets + 2 macos targets). The two jobs were 95% identical — same checkout, toolchain, cache, build, archive, upload steps. Only the runner OS differed. Windows stays separate because its archive logic uses 7z/.zip vs unix tar.gz. - Narrow top-level workflow permissions from `contents/id-token/ attestations: write` to just `contents: read`. The elevated perms needed for creating the GH release + provenance attestation now live on the `release` job only. Build jobs run with read-only token; the homebrew job pushes cross-repo via its own HOMEBREW_TAP_TOKEN so doesn't need workflow write either. Tighter blast radius. Net: 258 → 228 lines, single source of truth for unix archive logic, least-privilege for build jobs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Automates two manual release steps:
cargo release minor --execute(run locally) handles the version bump ineksup/Cargo.toml, regeneratescompletions/*andman/eksup.1, updates the README's example output, commits, tags, and pushes. Per project convention (no version bumps in feature PRs), this is the dedicated ceremony.homebrewjob inrelease.yamlrendersFormula/eksup.rbfrom a heredoc using the checksums of the released artifacts and pushes toclowdhaus/homebrew-taps. Replaces the manual edit-after-each-release workflow.Alongside the two automation wins, restructures
release.yamlto mirror ocync's proven pattern:crossfor everything (ubuntu-24.04-armfor Linux ARM,macos-13for Intel macOS,macos-latestfor Apple Silicon,windows-latestfor Windows). Faster, simpler debugging.softprops/action-gh-release) instead of 5 independent uploads viasvenstaro/upload-release-action --overwrite.validatejob confirms the git tag matcheseksup/Cargo.toml's version before consuming build minutes.sha256sums.txtgenerated and attached to every release.actions/attest-build-provenance) over all artifacts — supply-chain hygiene.stableinstead ofnightlyfor release builds, matching whatcargo install eksupusers get.version "X.Y.Z"(was"vX.Y.Z"), completions + man page installed via standard Homebrew helpers (was: missing entirely).contents: read; elevatedcontents/id-token/attestations: writescoped to thereleasejob only.Required maintainer action before first release
Add a
HOMEBREW_TAP_TOKENrepository secret toclowdhaus/eksup. A fine-grained PAT scoped toclowdhaus/homebrew-tapswithContents: Read and Writeis the safest shape. If a token already exists for the ocync release flow with the same tap repo scope, reuse it.Local ceremony (new normal)
```bash
One-time install:
cargo install cargo-release
Dry-run first:
cargo release minor
Execute when it looks right:
cargo release minor --execute
```
The tag push triggers the new workflow. xtask is excluded from the workspace bump (`release = false` in xtask/Cargo.toml) so only eksup gets versioned.
Test plan
🤖 Generated with Claude Code