Bumping Private Homebrew Dependencies

2019-08-26

Shopify has a big-ish collection of semi-private homebrew packages and I frequently explain how to bump versions, so here it is. In general:

  1. dev clone homebrew-shopify
  2. Find the Formula. For example, secret-sender
  3. Edit the URL to point to the archive for a new tag that you’ve created and pushed to the source repo.
  4. Fetch that URL using curl $url | shasum -a 256 and replace the sha256 in the file with that hash.
  5. If you currently have this formula installed, remove it with brew uninstall <formula>.
  6. Run brew install --build-bottle ./<my-formula>.rb (e.g. ./secret-sender.rb)
  7. Run brew bottle <my-formula> (e.g. secret-sender, not ./secret-sender.rb)
  8. Copy and paste the output of this command into the formula, replacing the previous bottle do paragraph, and add another line inside: root_url "https://github.com/Shopify/<repo>/releases/download/<tag>.
  9. Rename the resulting file, changing the -- into -. I have no idea why this part is necessary.
  10. Attach the resulting file to the release for the tag on GitHub.
  11. brew uninstall <my-formula> and brew install ./<my-formula>.rb to verify that it correctly downloads the bottle from github.
  12. Branch, commit, push, PR, merge.