Skip to content

Publish a Homebrew formula - #97

Merged
beetlebugorg merged 1 commit into
mainfrom
feat/homebrew-formula
Aug 28, 2026
Merged

beetlebugorg merged 1 commit into
mainfrom
feat/homebrew-formula

Conversation

@beetlebugorg

Copy link
Copy Markdown
Owner

What changes

brew install beetlebugorg/tap/go-dims installs the dims command, which signs URLs and runs the server. It follows the shape tile57 already uses: prebuilt archives, a formula generated from them, and a tap job that a candidate tag skips.

Releases carried Linux binaries only, so a formula built from them would have failed on macOS, where most people run brew. Two jobs now build macOS binaries.

  • build-macos builds arm64 on macos-latest and x86_64 on macos-15-intel, and attaches dims-macos-arm64.zip and dims-macos-amd64.zip.
  • scripts/brew-formula.sh prints the formula, reading each archive's sha256 out of the artifacts the release just built.
  • homebrew clones the tap, writes Formula/go-dims.rb, and pushes. It is gated on !contains(github.ref_name, '-'), so v1.0.0-rc1 leaves the tap alone and v1.0.0 updates it. A missing HOMEBREW_TAP_TOKEN logs a warning rather than failing the release.

The macOS build links Homebrew's libvips, so the formula carries depends_on "vips" inside on_macos. The Linux build is static, verified as not a dynamic executable, so it declares nothing.

The README gains an install section, and docs/docs/installation.md gains the standalone binary section its own introduction had been promising. The image tag table also gains the next row.

Verify

The formula was installed with Homebrew on Linux, from a local tap, using a formula generated against the real v1.0.0-rc1 archives:

==> Installing local/test/go-dims
馃嵑  /home/linuxbrew/.linuxbrew/Cellar/go-dims/1.0.0-rc1: 6 files, 11.9MB

$ dims version
1.0.0-rc1

==> Testing local/test/go-dims
==> .../bin/dims version

The generated sha256 matches the published archive, the Ruby parses, and shellcheck is clean on the generator. The dims binary sits at the root of each zip, which is what bin.install "dims" expects.

Note that Homebrew on Linux pulls gcc and binutils as dependencies of any formula without a bottle, even one that only unpacks a static binary. That is Homebrew's behaviour rather than something this formula asks for.

Not verified here

The macOS job cannot run on this machine. make all itself is already exercised by the existing version probe in pr.yml, so what is unproven is the macOS toolchain setup: brew install vips, the ANTLR wrapper, and PKG_CONFIG_PATH. The first tag to run this workflow will exercise it, and build-macos fails the release if the binary does not report the expected version.

- Build and attach macOS binaries for arm64 and x86_64.
- Generate the formula from the released archives.
- Update the tap when a version tag lands, skipping a candidate.
@beetlebugorg
beetlebugorg merged commit 27ebdc6 into main Aug 28, 2026
4 checks passed
@beetlebugorg
beetlebugorg deleted the feat/homebrew-formula branch August 28, 2026 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant