JSPM

@auto-it/brew

11.3.6
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 34
  • Score
    100M100P100Q74482F
  • License MIT

Automate the creation of Homebrew formulae.

Package Exports

  • @auto-it/brew
  • @auto-it/brew/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@auto-it/brew) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Brew Plugin

Automate the creation of Homebrew formulae. This plugin can be use with any other package manager plugin.

NOTE: This plugin does not work in lerna monorepos that use independent versioning.

Installation

This plugin is not included with the auto CLI installed via NPM. To install:

npm i --save-dev @auto-it/brew
# or
yarn add -D @auto-it/brew

Usage

To use this plugin you will need to add the required configuration and a template file.

  • executable - REQUIRED: The executable to create a formula for
  • name - REQUIRED: The name of the formula to create
  • formula - A path to the formula template. Default is './formula-template.rb'
{
  "plugins": [
    [
      "brew",
      {
        "executable": "path/to/some/executable",
        "name": "name-of-formula",
        "formula": "path/to/formula/template"
      }
    ]
  ]
}

Create a template name ./formula-template.rb at the root of the project (or use the formula option to customize the location)/ The template file must be a valid homebrew ruby file.

auto will replace the following tokens in the template file:

  • $VERSION - The version being published
  • $SHA - The sha of the executable being included in the formula

Here is the template auto uses to publish it's own brew formula:

class Auto < Formula
  desc "Generate releases based on semantic version labels on pull requests."
  homepage "https://intuit.github.io/auto/home.html"
  url "https://github.com/intuit/auto/releases/download/$VERSION/auto-macos.gz"
  version "$VERSION"
  sha256 "$SHA"

  def install
    libexec.install Dir["*"]
    bin.install libexec/"auto-macos"
    mv bin/"auto-macos", bin/"auto"
  end

  test do
    system bin/"auto", "--version"
  end
end

Multiple Formulae

You can also use this to create multiple brew formulae.

{
  "plugins": [
    [
      "brew",
      [
        {
          "executable": "path/to/some/executable",
          "name": "name-of-formula",
          "formula": "path/to/formula/template"
        },
        {
          "executable": "path/to/another/executable",
          "name": "another-formula",
          "formula": "path/to/formula/another"
        }
      ]
    ]
  ]
}