Skip to content

Instantly share code, notes, and snippets.

@dcaponi
Last active September 7, 2021 23:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcaponi/ffe2f22776c017a5f134f05203bb2d5f to your computer and use it in GitHub Desktop.
Save dcaponi/ffe2f22776c017a5f134f05203bb2d5f to your computer and use it in GitHub Desktop.
how to make brew formula for your go build.

Create Brew Tap - Because You're Not Cool Enough to be in the Official Brew Club

  1. create a new repository called homebrew-tap-your_app
  2. run git init and put the empty repository in Github
  3. create a new branch and run brew create --tap=USER/REPO --go https://github.com/user/repo/archive/vA.I.P.tar.gz (where A is Major, I is Minor and P is Patch version... obviously 😜) to create a new pre-gen formula in your empty project.
  4. Make sure the url in the pre-gen formula looks like https://github.com/user/repo/archive/refs/tags/vA.I.P.tar.gz
  5. If brew create doesn't already, copy the sha256 that gets stuck in your terminal output in the field for sha256
  6. push that shit and open a PR
  7. AFTER those are done, add the pr-pull label and wait for that action to run - this will add the bottles specified in the test-bot action in tests.yml (you don't have to update those SHAs on your own... dont panic)
  8. If it didn't blow up, you're donezo!

Update Brew Tap (Add New Version)

  1. create a branch in the https://github.com/onelogin/homebrew-tap-onelogin repo called vA.I.P
  2. update the url to point to the latest version of your go build (usually https://github.com/user/repo/archive/refs/tags/vA.I.P.tar.gz).
  3. run this curl https://codeload.github.com/user/repo/tar.gz/vA.I.P | openssl sha256... I have no idea why it looks for the version from codeload but whatever, thats what brew do boo.
  4. Copy/paste the sha256 output into the sha256 field (not the one in the bottles block)
  5. Push that shit and open a PR
  6. Let the github actions run
  7. AFTER those are done, add the pr-pull label and wait for that action to run - this will add the bottles specified in the test-bot action in tests.yml (you don't have to update those SHAs on your own... dont panic)
  8. If it didn't blow up, you're donezo!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment