build: release with goreleaser, a Homebrew tap, and a Nix flake - #3
Merged
Conversation
The v0.8.0 release never produced usable artifacts. Its matrix needed a macOS runner for the darwin targets, which queued indefinitely, and the checksums it did publish recorded `dist/`-prefixed paths that matched nothing where the assets are actually downloaded -- `sha256sum -c` printed three "No such file or directory" lines and still exited 0. Replace the hand-rolled matrix with goreleaser on a single Linux runner. Nothing in the build needs cgo: the darwin keychain backend shells out to /usr/bin/security via os/exec, verified with a set/get/delete round-trip from a CGO_ENABLED=0 binary whose `otool -L` lists only libSystem and libresolv. So every target cross-compiles from one runner, which also restores the Intel macOS build that da665a3 dropped on the mistaken grounds that darwin requires cgo. Publish a Homebrew cask to mondaycom/homebrew-tap. homebrew-core is not an option yet -- it requires notability the repo does not have -- and goreleaser deprecated `brews` in favour of `homebrew_casks`, since what it generated for pre-compiled binaries were "hackyish" formulas. The cask carries a postflight hook that strips com.apple.quarantine; without it macOS reports "mcli is damaged and cannot be opened", because these binaries are neither signed nor notarized. Tarballs are new; the bare `mcli-<os>-<arch>` binaries keep the names v0.8.0 used so existing download instructions still resolve. CI now runs `goreleaser check` and a full snapshot build on every PR, so a deprecated property fails a pull request instead of a tag push. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Gives Nix and NixOS users a first-class install (`nix profile install github:mondaycom/mcli`) and contributors a pinned dev shell, without waiting on a nixpkgs submission -- `mcli` is unclaimed there, but the package would live outside this repo and land on nixpkgs' review cadence. `nix build` runs the full test suite in the Nix sandbox, which has no network. That passes today: no test reaches the API, and the one test that touches a real keychain is behind the `keychain_real` build tag. CI builds the flake on every PR to guard vendorHash. It goes stale whenever go.mod or go.sum changes, and nothing else would catch it -- the Go build is unaffected, so the flake would stay broken until a user ran `nix run`. Co-Authored-By: Claude Opus 5 <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.
Why
v0.8.0 tagged but never shipped anything installable:
dist/-prefixed paths. Where the assets actually get downloaded,sha256sum -c checksums.txtprinted threeNo such file or directorylines — and exited 0. A verification step that always passes is worse than none.brewornixinstall path at all.What changed
goreleaser replaces the hand-rolled matrix (
.goreleaser.yaml,release.yml). Everything cross-compiles from oneubuntu-latestrunner.This also restores the Intel macOS build that da665a3 dropped. That commit's stated reason — "darwin builds require CGO (macOS Keychain), so they can't be cross-compiled" — is not the case:
zalando/go-keyring's darwin backend shells out to/usr/bin/securityviaos/execand contains no cgo. Verified empirically, not by reading: aCGO_ENABLED=0binary did a real keychain set/get/delete round-trip, andotool -Lon it lists only libSystem and libresolv.A Homebrew cask goes to mondaycom/homebrew-tap (repo created, README in place,
Casks/populated by the first release).brewsin favour ofhomebrew_casks, on the grounds that what it generated for pre-compiled binaries were "hackyish" formulas.com.apple.quarantinein a postflight hook. These binaries are neither signed nor notarized, and Homebrew quarantines cask downloads, so without it macOS reports "mcli is damaged and cannot be opened" on first run. The real fix is an Apple Developer signing identity plus notarization — worth doing later, out of scope here.A Nix flake (
flake.nix) givesnix profile install github:mondaycom/mcliplus a pinned dev shell, without waiting on nixpkgs' review cadence.mcliis unclaimed there and remains an option later.Tarballs are new. The bare
mcli-<os>-<arch>assets keep the names v0.8.0 used, so existingcurl -LOinstructions still resolve.CI gains two jobs.
packagingrunsgoreleaser checkand a full snapshot build, so a deprecated property fails a PR instead of a tag push.nixbuilds the flake to guardvendorHash— it goes stale whenevergo.mod/go.sumchanges, and nothing else would catch it, since the Go build is unaffected and the flake would stay broken until a user rannix run. Action versions bumped to current majors along the way.Verification
Run locally, not assumed:
goreleaser checkclean;goreleaser build --snapshotproduced all 4 targets and 8 assets.shasum -a 256 dist/mcli_darwin_arm64_v8.0/mclimatches itschecksums.txtentry. Flat names verify with exit 0; a tampered file givesFAILEDand exit 1 — the bug this PR fixes.on_macos/on_linux×on_arm/on_intelblocks and the postflight hook.nix build/nix run/nix developall work; the sandbox ran all 9 test packages green.make build,go vet,golangci-lint(0 issues),make testall pass.Before the next tag
HOMEBREW_TAP_TOKENhas to exist as an Actions secret — a PAT withcontents: writeonmondaycom/homebrew-tap. The per-runGITHUB_TOKENis scoped to this repository and can't push to another one. Without it the release step fails at the cask stage. (This is a GitHub PAT, not a monday API token.)Homebrew casks are macOS-only in practice; Linux users get Nix,
go install, or the tarballs.🤖 Generated with Claude Code