github.com/szyn/goreleaser@v0.76.1-0.20180517112710-333da09a1297/www/content/homebrew.md (about)

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