Skip to content

Instantly share code, notes, and snippets.

@leviable
Created June 20, 2025 18:58
Show Gist options
  • Save leviable/8847d71933a4c317e4a4aa4ec8bca63f to your computer and use it in GitHub Desktop.
Save leviable/8847d71933a4c317e4a4aa4ec8bca63f to your computer and use it in GitHub Desktop.
Steps to create a personal Homebrew tap with working CI

Steps for creating your own personal homebrew tap

These instructions reference the durdraw tool

  1. Create a new repo in github. It MUST be named "homebrew-durdraw" for the brew tap command to work as intended
  2. Install homebrew. It works well with linux and macos, for both x86_64 and arm64
  3. Create the tap locally: brew tap-new --branch main --github-packages leviable/durdraw
    a. Note the instructions it spits out at the end. Copy and save those elsewhere so you can reference them later if needed.
  4. cd into the new directory. You can get the file path with brew tap-info leviable/durdraw
  5. You may need to set your remote git remote set-url origin [email protected]:leviable/homebrew-durdraw.git and your master/main branch origin
  6. Check out a new branch, strongly suggest not merging directly to master/main
  7. Create your new formula, using the link to the latest github release:
brew create --python https://github.com/cmang/durdraw/archive/refs/tags/0.29.0.tar.gz --tap leviable/durdraw
  1. Copy the Formula/durdraw.rb from my repo to yours. You shouldn't need to make any changes
  2. At this point you can audit, test, and install the formula locally. It's helpful to do these locally before pushing, as CI will also do them, so its nice to know things are working before waiting on the CI cycle:
brew audit durdraw --strict
brew test durdraw
brew install durdraw
which durdraw  # should be in $(brew config | grep HOMEBREW_PREFIX)/bin
durdraw -V
  1. Commit your changes and push git push origin <your branch>
  2. Open your github repo in a browser and create a pull request. Github actions should kick off at this point. a. If you encounter any failures, fix them locally and commit with --amend and force push the amended commit. as CI expects there to be one and only one commit
  3. Finally, when you are ready to merge, create/add a pr-pull tag to the PR, and CI will do the rest, including closing the PR and publishing everything to github packages. Check brew commands for other supported tags (pr-automerge, pr-publish, etc)
  4. At this point all your users need to do is tap and install
brew tap leviable/durdraw
brew install durdraw
  1. When durdraw releases a new version, all you need to do for your homebrew repo is run brew bump-formula-pr and repeat the push/tag workflow. If you want to get even fancier you can setup triggers so that when you cut a release in the durdraw repo, a PR in this new homebrew repo gets automatically created.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment