Homebrew Tap Automation Setup #
This guide explains how to set up the automated Homebrew tap updates for Velo releases.
Prerequisites #
- Access to both repositories:
dimaosipa/velocity
(main repo)dimaosipa/brew
(tap repo)
- Formula file already exists at
dimaosipa/brew/Formula/velo.rb
Setup Steps #
1. Create GitHub Personal Access Token #
- Go to GitHub Settings → Developer Settings → Personal Access Tokens → Tokens (classic)
- Click “Generate new token (classic)”
- Give it a descriptive name:
HOMEBREW_TAP_TOKEN
- Select scopes:
- ✅
repo
(Full control of private repositories) - ✅
workflow
(Update GitHub Action workflows)
- ✅
- Set expiration (recommend: 1 year)
- Click “Generate token”
- Copy the token immediately (you won’t see it again!)
2. Add Token to Repository Secrets #
- Go to
dimaosipa/velocity
repository - Navigate to Settings → Secrets and variables → Actions
- Click “New repository secret”
- Name:
HOMEBREW_TAP_TOKEN
- Value: Paste the token from step 1
- Click “Add secret”
How It Works #
For Tagged Releases #
When you create a new release (e.g., v1.0.0
):
- Push tag:
git tag v1.0.0 && git push origin v1.0.0
- Release workflow automatically:
- Builds the binary
- Creates GitHub release
- Updates
dimaosipa/brew/Formula/velo.rb
- Users can immediately:
brew update && brew upgrade velo
For Development Builds #
Every push to main branch:
- Creates/updates a “nightly” pre-release
- Provides stable URL for testing
- (Optional) Can update tap with dev version
Testing #
To test the automation:
- Create a test tag:
git tag v0.0.3-test
- Push it:
git push origin v0.0.3-test
- Watch the Actions tab for progress
- Check
dimaosipa/brew
for the automated commit - Test installation:
brew install dimaosipa/brew/velo
Troubleshooting #
Token Issues #
If you see “Bad credentials” errors:
- Verify token hasn’t expired
- Ensure token has correct permissions
- Check secret name matches exactly:
HOMEBREW_TAP_TOKEN
Formula Update Fails #
If the formula update fails:
- Ensure
Formula/velo.rb
exists in tap repo - Check that formula class name is
class Velo < Formula
- Verify download URL is accessible
Manual Testing #
Test the download URL manually:
curl -L https://github.com/dimaosipa/velocity/releases/download/v0.0.3/velo-v0.0.3-arm64.tar.gz -o test.tar.gz
shasum -a 256 test.tar.gz
Enabling Development Builds #
To enable Homebrew updates for development builds:
- Edit
.github/workflows/ci.yml
- Uncomment the “Update Homebrew Tap (Development)” section
- This will update tap on every main branch push
⚠️ Warning: This can create many commits in your tap repo!