This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Homebrew tap that distributes SourceGit (a Git GUI client) with proper macOS code signing and notarization. The repository automatically:
- Detects new SourceGit releases from the upstream repository
- Downloads, signs, and notarizes the macOS app
- Publishes signed DMG files as GitHub releases
- Updates the Homebrew cask formula to point to the signed version
The tap URL is ybeapps/homebrew-sourcegit and users install with:
brew tap ybeapps/homebrew-sourcegit
brew install --cask sourcegitCasks/sourcegit.rb- Homebrew cask formula that defines how to install SourceGit.github/workflows/update_tap_upon_new_version.yml- GitHub Actions workflow that automates signing and publishing
The cask formula follows Homebrew's Ruby DSL format:
version- The version number without the 'v' prefix (e.g., "2025.40")sha256- SHA256 checksum of the DMG file for integrity verificationurl- Points to the signed DMG in this repo's GitHub releases (format:v{VERSION}-signedtag)app "SourceGit.app"- Installs the application to/Applicationszap trash:- Defines user data locations to remove when uninstalling withbrew zap
The cask points to signed DMG files hosted in this repository's releases, NOT the upstream SourceGit repository.
The workflow (update_tap_upon_new_version.yml) runs on:
- Schedule: 4 times daily (00:00, 06:00, 12:00, 18:00 UTC)
- Manual trigger: Via workflow_dispatch with optional version override and force update
- Version Detection: Fetches latest release from
sourcegit-scm/sourcegitvia GitHub API or uses manually specified version - Version Comparison: Compares with current version in
sourcegit.rb, skips if unchanged (unless forced) - Check for Existing Signed Release: Looks for
{VERSION}-signedtag in this repo's releases - Download & Extract: Downloads ARM64 zip from upstream (
sourcegit_{VERSION}.osx-arm64.zip) - Code Signing:
- Imports Apple Developer ID certificate from secrets
- Creates entitlements file with JIT and runtime permissions
- Signs frameworks, dylibs, executables, and app bundle with
codesign - Uses
--options runtimeand--timestampfor notarization compatibility
- Create DMG: Packages signed app into DMG with
hdiutiland signs the DMG - Notarize: Submits to Apple's notary service using
xcrun notarytool, waits up to 30 minutes, and staples ticket - Calculate SHA256: Computes checksum for the cask formula
- Publish Release: Creates GitHub release with tag
{VERSION}-signedcontaining the signed DMG - Update Cask: Rewrites
Casks/sourcegit.rbwith new version, SHA256, and URL pointing to the signed release
The workflow requires these secrets:
APPLE_CERTIFICATE_BASE64- Base64-encoded .p12 certificate fileAPPLE_CERTIFICATE_PASSWORD- Password for the .p12 fileAPPLE_IDENTITY- Developer ID identity name (e.g., "Developer ID Application: Your Name (TEAMID)")APPLE_ID- Apple ID email for notarizationAPPLE_APP_PASSWORD- App-specific password for Apple IDAPPLE_TEAM_ID- 10-character team IDKEYCHAIN_PASSWORD- Temporary keychain password (can be any value)GH_TOKEN- GitHub personal access token with repo permissions for committing
When manually updating the cask formula:
- Update
versionto match the version number (without 'v' prefix) - Update
sha256with the checksum of the new DMG - Update
urlto point to the correct signed release tag and filename - Ensure the URL format is:
https://github.com/ybeapps/homebrew-sourcegit/releases/download/v{VERSION}-signed/SourceGit-v{VERSION}-signed.dmg
The workflow typically handles updates automatically, but manual intervention may be needed if:
- The workflow fails during signing/notarization
- A specific version needs to be published outside the schedule
- Secret credentials need to be rotated
# Audit the cask for style issues
brew audit --cask sourcegit
# Install locally from this tap
brew install --cask --force ybeapps/sourcegit/sourcegit
# Test uninstall
brew uninstall --cask sourcegit
# Test zap (removes user data)
brew uninstall --zap --cask sourcegitCommon failure points:
- Version detection fails: Check GitHub API rate limits or upstream repo accessibility
- Download fails: Verify upstream release exists and has the ARM64 zip file
- Signing fails: Check certificate expiration, keychain setup, or identity name
- Notarization fails: Verify Apple credentials, team ID, app-specific password, or entitlements
- Push fails: Verify GH_TOKEN permissions and git configuration
To manually trigger with a specific version:
- Go to Actions tab
- Select "Auto Sign and Update SourceGit" workflow
- Click "Run workflow"
- Enter version (e.g., "v8.40") or leave empty for latest
- Check "Force update" to re-sign even if version exists