homebrew#
Homebrew bottle builder and tap manager for OCaml monorepos.
Overview#
Build, upload, and release Homebrew bottles from dune monorepos. Generates Ruby formulas with platform-specific SHA256 checksums, uploads bottles to S3-compatible storage, and manages tap repositories.
Features#
- YAML configuration for binary definitions and storage settings
- Platform-aware bottle building (macOS ARM64/Intel, Linux x86_64/ARM64)
- S3-compatible storage upload via rclone (dated + rolling "latest" releases)
- Automatic Ruby formula generation with head-build support
- SHA256 checksum computation and formula updating
- Full release workflow: build, upload, update tap, commit and push
Installation#
opam install homebrew
Configuration#
Create a homebrew.yml file:
handle: gazagnaire.org
storage:
bucket: homebrew-bottles
region: fr-par
profile: homebrew-monopam
tap:
clone_url: https://tangled.org/gazagnaire.org/homebrew-monopam.git
push_url: git@git.recoil.org:gazagnaire.org/homebrew-monopam
binaries:
- name: prune
package: prune
description: "Dead code remover for OCaml .mli files"
homepage: https://tangled.org/gazagnaire.org/prune
- name: merlint
package: merlint
description: "Opinionated OCaml linter powered by Merlin"
- name: agent
package: ocaml-agent
description: "Claude Code container orchestrator"
exe_name: main
head_deps:
- name: docker
type: recommended
Optional fields#
| Field | Default |
|---|---|
mono_url |
https://tangled.org/{handle}/mono.git |
license |
ISC |
build_dir |
_homebrew_build |
storage.endpoint |
https://s3.{region}.scw.cloud |
storage.rclone_remote |
scaleway |
tap.local_path |
../homebrew-monopam |
binary.homepage |
https://tangled.org/{handle}/{package} |
binary.exe_name |
Same as binary name |
binary.head_deps |
[] |
Usage#
# Show parsed configuration
bottler config -c homebrew.yml
# Build bottles for current platform
bottler build -c homebrew.yml
# Build specific binaries only
bottler build -c homebrew.yml prune merlint
# Upload bottles to S3
bottler upload -c homebrew.yml
# Generate formula files
bottler formula -c homebrew.yml
# Full release: build + upload + update tap
bottler release -c homebrew.yml
API#
Homebrew.load_config- Load YAML configurationHomebrew.detect_platform- Detect current build platformHomebrew.build- Build bottlesHomebrew.upload- Upload to S3 storageHomebrew.generate_formula- Generate Ruby formulaHomebrew.sha256_file- Compute SHA256 digestHomebrew.release- Full release workflow
Related Work#
- homebrew-core - The official Homebrew formula repository
- goreleaser - Go binary release automation (similar concept for Go)
- cargo-dist - Rust binary distribution tool
Licence#
ISC License. See LICENSE.md for details.