Skip to content

Homebrew

Pushes a new or updated Homebrew formula to a tap repository. The formula is committed directly to the master branch.

Configuration

OptionDescription
tapHomebrew tap name (e.g., octocat/toolsgithub.com:octocat/homebrew-tools)
templateFormula template (Ruby code) with Mustache interpolation
formulaFormula name. Default: repository name
pathPath to store formula. Default: Formula

Template Variables

  • version: The new version
  • revision: The tag’s commit SHA
  • checksums: Map of sha256 checksums by filename (dots replaced with __, version with __VERSION__)

Environment Variables

NameDescription
GITHUB_TOKENGitHub API token

Example

targets:
- name: brew
tap: octocat/tools
formula: myproject
path: HomebrewFormula
template: >
class MyProject < Formula
desc "This is a test for homebrew formulae"
homepage "https://github.com/octocat/my-project"
url "https://github.com/octocat/my-project/releases/download/{{version}}/binary-darwin"
version "{{version}}"
sha256 "{{checksums.binary-darwin}}"
def install
mv "binary-darwin", "myproject"
bin.install "myproject"
end
end