github.com/goreleaser/goreleaser@v1.25.1/www/docs/blog/posts/2022-03-07-homebrew-gofish.md (about)

     1  ---
     2  date: 2022-03-07
     3  slug: homebrew-gofish
     4  categories:
     5    - tutorials
     6  authors:
     7    - dirien
     8  ---
     9  
    10  # GoReleaser: How To Distribute Your Binaries With Homebrew Or GoFish
    11  
    12  This article is going to be a quick bite (or drink)! We going to discover, how
    13  fast we can create a **Homebrew** or **GoFish** deployment of our binaries with
    14  the help of **GoReleaser**.
    15  
    16  <!-- more -->
    17  
    18  But first, let us take a look into the concepts of the two package managers:
    19  
    20  ### **Homebrew **🍺
    21  
    22  > The Missing Package Manager for macOS (or Linux)
    23  
    24  This statement is not from me, but from the official
    25  [Homebrew](https://brew.sh/) website. **Homebrew** is similar to other package
    26  managers, like [apt-get](https://wiki.debian.org/apt-get),
    27  [aptitude](https://wiki.debian.org/Aptitude), or
    28  [dpkg](https://wiki.debian.org/dpkg). I will not go in this article into the
    29  details about **Homebrew**, but some terms are important to understand, as we
    30  going to use them in our `.goreleaser.yaml` file:
    31  
    32  **Tap:** A Git repository of packages.
    33  
    34  **Formula**: A software package. When we want to install new programs or
    35  libraries, we install a formula.
    36  
    37  ### GoFish 🐠
    38  
    39  > GoFish, the Package Manager 🐠
    40  
    41  [GoFish](https://gofi.sh/) is a cross-platform systems package manager, bringing
    42  the ease of use of Homebrew to Linux and Windows. Same as with **Homebrew**, I
    43  am not going into detail of **GoFish** but we need also here some understanding
    44  of the **GoFish** terminology:
    45  
    46  **Rig:** A git repository containing fish food.
    47  
    48  **Food:** The package definition
    49  
    50  ### The example code
    51  
    52  For each package manager, you should create its own GitHub repository. You can
    53  name it as you please, but i prefer to add the meaning of the repository.
    54  
    55  - **goreleaser-rig** for GoFish
    56  - **goreleaser-tap** for Homebrew
    57  
    58  Add following snippet for **GoFish** support, to your existing
    59  `.goreleaser.yaml`:
    60  
    61  ```yaml
    62  rigs:
    63    - rig:
    64        owner: dirien
    65        name: goreleaser-rig
    66      homepage: "https://github.com/dirien/quick-bites"
    67      description: "Different type of projects, not big enough to warrant a separate repo."
    68      license: "Apache License 2.0"
    69  ```
    70  
    71  And for **Homebrew**, add this little snippet:
    72  
    73  ```yaml
    74  brews:
    75    - tap:
    76        owner: dirien
    77        name: goreleaser-tap
    78      folder: Formula
    79      homepage: "https://github.com/dirien/quick-bites"
    80      description: "Different type of projects, not big enough to warrant a separate repo."
    81      license: "Apache License 2.0"
    82  ```
    83  
    84  That’s all for now, and as usual with GoReleaser you can head over to the great
    85  documentation for more advanced settings:
    86  
    87  > [https://goreleaser.com](https://goreleaser.com/intro/)
    88  
    89  Now run the release process and you will see this in your logs:
    90  
    91  ```
    92    • homebrew tap formula
    93             • pushing formula=Formula/goreleaser-brew-fish.rb repo=dirien/goreleaser-tap
    94    • gofish fish food cookbook
    95             • pushing food=Food/goreleaser-brew-fish.lua repo=dirien/goreleaser-rig
    96  ```
    97  
    98  Perfect! Everything works as expected.
    99  
   100  We can check the content on the GitHub UI.
   101  
   102  ![](https://cdn-images-1.medium.com/max/5964/1*O2zfXri4yrmo_GN3clczow.png)
   103  
   104  ![](https://cdn-images-1.medium.com/max/6020/1*1TVV84tYM1staeDcifH7tw.png)
   105  
   106  ### Installation
   107  
   108  Now we can add the tap and the rig on our clients
   109  
   110  **Homebrew**
   111  
   112  ```bash
   113  brew tap dirien/goreleaser-tap
   114  brew install goreleaser-brew-fish
   115  ```
   116  
   117  **GoFish**
   118  
   119  ```bash
   120  gofish rig add https://github.com/dirien/goreleaser-rig
   121  gofish install github.com/dirien/goreleaser-rig/goreleaser-brew-fish
   122  ```
   123  
   124  ### The End
   125  
   126  Now you can distribute this tap or rig repositories and everybody can install your projects via this package manager.
   127  
   128  ![](https://cdn-images-1.medium.com/max/2560/0*prjIhehAsUYTBaLx.jpg)
   129  
   130  ### The Code
   131  
   132  You can find the demo code in my repository, to see some more details:
   133  [dirien/quick-bites](https://github.com/dirien/quick-bites/tree/main/goreleaser-brew-fish).