Skip to content

Add release binaries for Homebrew distribution #16

@chicks-net

Description

@chicks-net

Problem

Currently, releases don't include compiled binaries that can be consumed by Homebrew or other package managers. Users need to build from source.

Proposed Solution

Set up automated binary builds for releases that generate platform-specific artifacts suitable for Homebrew formula distribution.

Target Platforms

  • macOS (Apple Silicon: aarch64-apple-darwin)
  • macOS (Intel: x86_64-apple-darwin)
  • Linux (x86_64-unknown-linux-gnu)
  • Linux (x86_64-unknown-linux-musl) - for maximum compatibility

Implementation Options

  1. GitHub Actions with cross-compilation

    • Use cross or native runners for each platform
    • Trigger on tag push or release creation
    • Upload binaries as release assets
  2. cargo-dist

    • Purpose-built tool for Rust binary distribution
    • Handles cross-compilation and asset uploads
    • Generates installation scripts and Homebrew tap boilerplate
    • See: https://opensource.axo.dev/cargo-dist/
  3. Manual GitHub Actions workflow

    • Custom workflow using actions/upload-release-asset
    • More control but more maintenance

Deliverables

  • Binary artifacts attached to GitHub releases
  • Checksums (SHA256) for each binary
  • Archive format: .tar.gz with version in filename (e.g., macaw-v0.1.0-x86_64-apple-darwin.tar.gz)
  • Documentation on creating Homebrew formula (or generate tap automatically)

Homebrew Integration

Once binaries are available, a Homebrew formula would look like:

class Macaw < Formula
  desc "Domain registration backend integrating with OpenSRS API"
  homepage "https://github.com/fini-net/macaw"
  version "0.1.0"
  
  if OS.mac? && Hardware::CPU.arm?
    url "https://github.com/fini-net/macaw/releases/download/v0.1.0/macaw-v0.1.0-aarch64-apple-darwin.tar.gz"
    sha256 "..."
  elsif OS.mac? && Hardware::CPU.intel?
    url "https://github.com/fini-net/macaw/releases/download/v0.1.0/macaw-v0.1.0-x86_64-apple-darwin.tar.gz"
    sha256 "..."
  elsif OS.linux?
    url "https://github.com/fini-net/macaw/releases/download/v0.1.0/macaw-v0.1.0-x86_64-unknown-linux-musl.tar.gz"
    sha256 "..."
  end

  def install
    bin.install "macaw"
  end
end

Related Commands

The existing just release <version> command creates releases with auto-generated notes. This workflow would extend that process to include binary artifacts.

References

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions