github.com/droot/goreleaser@v0.66.2-0.20180420030140-c2db5fb17157/docs/120-homebrew.md (about)

     1  ---
     2  title: Homebrew
     3  ---
     4  
     5  After releasing to GitHub, GoReleaser can generate and publish a _homebrew-tap_
     6  recipe into a repository that you have access to.
     7  
     8  The `brew` section specifies how the formula should be created.
     9  You can check the
    10  [Homebrew documentation](https://github.com/Homebrew/brew/blob/master/docs/How-to-Create-and-Maintain-a-Tap.md)
    11  and the
    12  [formula cookbook](https://github.com/Homebrew/brew/blob/master/docs/Formula-Cookbook.md)
    13  for more details.
    14  
    15  ```yml
    16  # .goreleaser.yml
    17  brew:
    18    # Name of the recipe
    19    # Default to project name
    20    name: myproject
    21  
    22    # Reporitory to push the tap to.
    23    github:
    24      owner: user
    25      name: homebrew-tap
    26  
    27    # Allows you to set a custom download strategy.
    28    # Default is empty.
    29    download_strategy: GitHubPrivateRepositoryReleaseDownloadStrategy
    30  
    31    # Git author used to commit to the repository.
    32    # Defaults are shown.
    33    commit_author:
    34      name: goreleaserbot
    35      email: goreleaser@carlosbecker.com
    36  
    37    # Folder inside the repository to put the formula.
    38    # Default is the root folder.
    39    folder: Formula
    40  
    41    # Caveats for the user of your binary.
    42    # Default is empty.
    43    caveats: "How to use this binary"
    44  
    45    # Your app's homepage.
    46    # Default is empty.
    47    homepage: "https://example.com/"
    48  
    49    # Your app's description.
    50    # Default is empty.
    51    description: "Software to create fast and easy drum rolls."
    52  
    53    # Setting this will prevent goreleaser to actually try to commit the updated
    54    # formula - instead, the formula file will be stored on the dist folder only,
    55    # leaving the responsibility of publishing it to the user.
    56    # Default is false.
    57    skip_upload: true
    58  
    59    # Packages your package depends on.
    60    dependencies:
    61      - git
    62      - zsh
    63  
    64    # Packages your source package depends on.
    65    build_dependencies:
    66      - make
    67      - gcc
    68  
    69    # Packages that conflict with your package.
    70    conflicts:
    71      - svn
    72      - bash
    73  
    74    # Specify for packages that run as a service.
    75    # Default is empty.
    76    plist: |
    77      <?xml version="1.0" encoding="UTF-8"?>
    78      ...
    79  
    80    # So you can `brew test` your formula.
    81    # Default is empty.
    82    test: |
    83      system "#{bin}/program --version"
    84      ...
    85  
    86    # Custom install script for brew.
    87    # Default is 'bin.install "program"'.
    88    install: |
    89      bin.install "program"
    90      ...
    91  ```
    92  
    93  By defining the `brew` section, GoReleaser will take care of publishing the
    94  Homebrew tap.
    95  Assuming that the current tag is `v1.2.3`, the above configuration will generate a
    96  `program.rb` formula in the `Formula` folder of `user/homebrew-tap` repository:
    97  
    98  ```rb
    99  class Program < Formula
   100    desc "How to use this binary"
   101    homepage "https://github.com/user/repo"
   102    url "https://github.com/user/repo/releases/download/v1.2.3/program_v1.2.3_macOs_64bit.zip"
   103    version "v1.2.3"
   104    sha256 "9ee30fc358fae8d248a2d7538957089885da321dca3f09e3296fe2058e7fff74"
   105  
   106    depends_on "git"
   107    depends_on "zsh"
   108  
   109    def install
   110      bin.install "program"
   111    end
   112  end
   113  ```
   114  
   115  **Important**": Note that GoReleaser does not yet generate a valid
   116  homebrew-core formula. The generated formulas are meant to be published as
   117  [homebrew taps](https://docs.brew.sh/Taps.html), and in their current
   118  form will not be accepted in any of the official homebrew repositories.