Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@phette23
Created December 1, 2022 17:34
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 phette23/e35a7192a8504f884930c2278e17bce8 to your computer and use it in GitHub Desktop.
Save phette23/e35a7192a8504f884930c2278e17bce8 to your computer and use it in GitHub Desktop.
bumping a homebrew formula version in brief

The How to Open a Homebrew Pull Request documentation is great. This doc assumes you've already created a fork of homebrew-core named after your user and a branch tracking the master of the fork.

cd (brew --repository homebrew/core)
brew update
git checkout phette23 # tracks master branch of fork
git pull # might need to sync fork to homebrew?
set FORMULA marcli # name of the project you're bumping
set VERSION 1.1.0 # semantic version
brew bump-formula-pr --no-fork --url https://github.com/account/$FORMULA/archive/refs/tags/v$VERSION.tar.gz project
brew install --build-from-source $FORMULA
brew test $FORMULA
brew audit --strict --online $FORMULA
git push --set-upstream phette23 (git branch --show-current) # branch will be named like "bump-$FORMULA-$VERSION"
gh pr create --web # or you could do gh pr create by itself but it's easier to edit the PR text in browser

brew bump-formula-pr has a lot of options you can use but it mostly parses everything from the GitHub release URL (copy the .tar.gz one) so you don't need to use flags like --version or --sha256. The command would be more complicated for something not hosted on GitHub.

Also this assumes there's no fundamental change to how the formula works that would required editing it (brew edit $FORMULA) like changing the test or dependencies or build process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment