This document explains how to set up and maintain Homebrew distribution for Phim.
A Homebrew tap is a separate Git repository that contains your formula. For Phim, you'll need to create a new repository called homebrew-phim.
-
Create a new GitHub repository named
homebrew-phim -
Clone it locally:
git clone https://github.com/roelvangils/homebrew-phim.git cd homebrew-phim -
Copy the tap files from this repository:
cp -R /path/to/phim/homebrew-tap/* .
-
Commit and push:
git add . git commit -m "Initial Homebrew tap for Phim" git push origin main
When you want to release a new version of Phim:
-
Update the version in
Phim.app/Contents/Info.plist -
Build and prepare the release:
./prepare_homebrew_release.sh 0.3.0 # Replace with your version -
Create a GitHub release:
- Go to https://github.com/roelvangils/phim/releases/new
- Create a new tag (e.g.,
v0.3.0) - Upload the
releases/Phim-0.3.0.zipfile - Publish the release
-
Update the tap repository:
- The
prepare_homebrew_release.shscript has already updated the formula - Push the changes to your tap repository:
cd homebrew-tap git add Casks/phim.rb git commit -m "Update Phim to version 0.3.0" git push origin main
- The
Test that your tap works correctly:
# Remove any existing installation
brew uninstall --cask phim 2>/dev/null
brew untap roelvangils/phim 2>/dev/null
# Add your tap and install
brew tap roelvangils/phim
brew install --cask phim
# Verify it works
phim https://example.comYour repositories should be organized as follows:
github.com/roelvangils/
├── phim/ # Main application repository
│ ├── PhimSource/ # Swift source code
│ ├── Phim.app/ # Built application
│ ├── releases/ # Release artifacts
│ │ └── Phim-X.Y.Z.zip # Zipped app for distribution
│ └── prepare_homebrew_release.sh
│
└── homebrew-phim/ # Homebrew tap repository
├── README.md
└── Casks/
└── phim.rb # Homebrew formula
The formula (Casks/phim.rb) contains:
- version: The current version number
- sha256: SHA-256 hash of the release ZIP file
- url: Direct link to the GitHub release asset
- dependencies: macOS version requirements
- auto_updates: Enabled for Sparkle updates
Users can install Phim via Homebrew with:
# First time installation
brew tap roelvangils/phim
brew install --cask phim
# Updating
brew update
brew upgrade --cask phim
# Uninstalling
brew uninstall --cask phimBefore pushing, validate your formula:
brew audit --strict --online phim- SHA256 mismatch: Make sure you're using the correct hash from the actual release file
- URL not found: Ensure the GitHub release is published and the asset is uploaded
- Tap not found: Check that the repository name is exactly
homebrew-phim
- ✅ Easy installation for users
- ✅ Automatic dependency management
- ✅ Simple updates via
brew upgrade - ✅ Works alongside Sparkle auto-updates
- ✅ Professional distribution method
- ✅ Integration with other Homebrew tools
- Create the
homebrew-phimrepository on GitHub - Set up the initial tap structure
- Create your first release
- Test the installation process
- Add the Homebrew badge to your README