This document explains how to use and maintain the DeepDiff DB Homebrew tap.
Once the tap is published, users can install deepdiff-db using:
# Tap the repository
brew tap iamvirul/deepdiff-db
# Install deepdiff-db
brew install deepdiff-dbOr install in one command:
brew install iamvirul/deepdiff-db/deepdiff-dbTo install the latest development version:
brew install --HEAD iamvirul/deepdiff-db/deepdiff-dbTo upgrade to the latest version:
brew upgrade deepdiff-dbbrew uninstall deepdiff-db
brew untap iamvirul/deepdiff-dbThe Homebrew tap is integrated directly into this repository. The Formula directory contains the formula file that Homebrew will use.
deepdiff-db/
├── Formula/
│ └── deepdiff-db.rb # Homebrew formula
├── HOMEBREW_TAP.md # This documentation
└── README.md # Updated with Homebrew installation instructions
When releasing a new version, follow these steps:
-
Create and push a new Git tag:
git tag v0.7 git push origin v0.7
-
Calculate the SHA256 for the release tarball:
# Download the release tarball wget https://github.com/iamvirul/deepdiff-db/archive/refs/tags/v0.7.tar.gz # Calculate SHA256 shasum -a 256 v0.7.tar.gz
-
Update the formula file (
Formula/deepdiff-db.rb):- Update the
urlfield with the new version - Update the
sha256field with the calculated hash - Example:
url "https://github.com/iamvirul/deepdiff-db/archive/refs/tags/v0.7.tar.gz" sha256 "abc123..." # Replace with actual hash
- Update the
-
Test the formula locally:
# Audit the formula for issues brew audit --strict Formula/deepdiff-db.rb # Test installation brew install --build-from-source Formula/deepdiff-db.rb # Run formula tests brew test deepdiff-db # Uninstall after testing brew uninstall deepdiff-db
-
Commit and push the updated formula:
git add Formula/deepdiff-db.rb git commit -m "chore(homebrew): Update formula to v0.7" git push origin main
You can automate SHA256 calculation using this command:
VERSION=v0.7
curl -L "https://github.com/iamvirul/deepdiff-db/archive/refs/tags/${VERSION}.tar.gz" | shasum -a 256Before pushing formula updates, always test:
# Validate syntax and style
brew audit --strict --online Formula/deepdiff-db.rb
# Test installation from source
brew install --build-from-source --verbose Formula/deepdiff-db.rb
# Test the installed binary
deepdiffdb --help
# Run automated tests
brew test deepdiff-dbIssue: SHA256 mismatch
- Solution: Recalculate the hash from the actual release tarball
- GitHub may regenerate tarballs, so always download and verify
Issue: Build failures
- Solution: Ensure Go version compatibility in the formula
- Test with
brew install --build-from-source --verbose
Issue: Formula audit warnings
- Solution: Run
brew audit --strictand fix reported issues - Follow Homebrew's formula style guidelines
This repository includes a GitHub Action that automatically updates the formula when new releases are published.
Workflow file: .github/workflows/update-homebrew-formula.yml
Triggers:
- Automatic: Runs automatically when a new GitHub release is published
- Manual: Can be triggered manually via workflow_dispatch for specific versions
What it does:
- Detects the new release version
- Downloads the release tarball
- Calculates the SHA256 checksum
- Updates
Formula/deepdiff-db.rbwith new version and checksum - Commits and pushes changes to the main branch
- Adds a summary comment to the release
Manual trigger example:
# Via GitHub CLI
gh workflow run update-homebrew-formula.yml -f version=v0.7
# Or use the GitHub Actions tab in the repositoryNote: With this automation in place, you typically don't need to manually update the formula unless the automation fails or you need to make other changes (dependencies, build flags, etc.).
- Users should refer to the main README.md for installation instructions
- Report formula issues to the GitHub Issues page
- Follow Homebrew's Formula Cookbook for best practices