Skip to content

Conversation

@leggetter
Copy link
Collaborator

@leggetter leggetter commented Oct 7, 2025

Implements a comprehensive Homebrew cask migration strategy following GoReleaser v2.10+ best practices for distributing pre-built binaries.

Changes

GoReleaser Configuration (.goreleaser/mac.yml)

  • ✅ Added homebrew_casks configuration alongside existing brews formula
  • ✅ Configured automatic shell completions installation (bash, zsh) for cask
  • ✅ Added conflicts_with formula: "hookdeck" directive to prevent simultaneous installation
  • ✅ Added deprecation warning to formula with migration instructions

Testing Infrastructure

  • ✅ Created comprehensive Homebrew build validation script (test-scripts/test-homebrew-build.sh)
    • Validates both formula and cask generation
    • Checks for deprecation warnings
    • Verifies conflicts_with directive
    • Tests shell completions packaging
  • ✅ Added GitHub Actions workflow (.github/workflows/test-homebrew-build.yml)
    • Runs on PRs and pushes to main
    • Automated CI/CD testing for Homebrew configurations

Project Organization

  • ✅ Moved acceptance tests to test-scripts/ directory for better organization
  • ✅ Renamed workflow files for consistency (test-acceptance.yml)

Migration Strategy

This implementation provides a transition period where both formula and cask distributions work:

  1. Formula (Deprecated): Shows clear warning message guiding users to migrate
  2. Cask (Recommended): New distribution method with automatic completions
  3. Conflict Prevention: conflicts_with ensures users can't install both simultaneously

User Migration Path

# Uninstall old formula
brew uninstall hookdeck

# Install new cask
brew install --cask hookdeck/hookdeck/hookdeck

Testing

The new test infrastructure validates:

  • ✅ Formula and cask YAML generation
  • ✅ Deprecation warnings presence
  • ✅ Conflicts directive
  • ✅ Shell completions bundling

Run locally:

./test-scripts/test-homebrew-build.sh

References

Next Steps

Implement #158

Migrated from Homebrew formula to cask following GoReleaser best practices
for distributing pre-built binaries. Maintained backward compatibility with
a dual distribution strategy during the transition period.

Changes:
- Added scripts/completions.sh to pre-generate shell completions
- Updated .goreleaser/mac.yml with dual distribution (formula + cask)
- Formula (brews): Added deprecation warning directing users to cask
- Cask (homebrew_casks): Configured with automatic completion installation
- Added completions/ to .gitignore

Key improvements:
- Completions now auto-installed for both formula and cask users
- Conflict prevention between formula and cask installations
- Clear migration path with 3-6 month deprecation timeline
- Follows GoReleaser v2.10+ recommendations for binary distribution

The formula will be removed after a 3-6 month transition period, giving
users time to migrate to the cask installation method.

Ref: https://goreleaser.com/blog/goreleaser-v2.10/\#homebrew-casks
- Update GoReleaser config with both formula (deprecated) and cask
- Add conflicts_with directive to prevent formula/cask conflicts
- Create comprehensive Homebrew build validation script
- Add GitHub Actions workflow for automated testing
- Move acceptance tests to test-scripts/ directory
The migration provides a transition period where both formula and cask
work, with clear deprecation warnings guiding users to migrate from
formula to cask distribution.

Following GoReleaser best practices for distributing pre-built binaries.
@leggetter leggetter requested a review from alexluong October 7, 2025 23:07
…n approach

- Remove custom_block with conflicts_with from Homebrew cask config
- Update cask caveats with migration instructions for binary conflict errors
- Remove conflict detection test from test-homebrew-build.sh
- Remove cask validation check for conflicts_with directive
- Add troubleshooting section to README for binary already exists error
- Focus tests on clean installs rather than conflict detection
Homebrew deprecated conflicts_with with no replacement. Instead of trying
to enforce conflicts, we now rely on Homebrew's native warnings and provide
clear migration instructions in both the cask caveats and README.
@leggetter leggetter changed the title feat: Implement Homebrew cask migration with dual distributionfeat: Implement Homebrew cask migration with dual distribution feat: Implement Homebrew cask migration wfeat: Implement Homebrew cask migration with dual distribution Oct 8, 2025
@leggetter leggetter changed the title feat: Implement Homebrew cask migration wfeat: Implement Homebrew cask migration with dual distribution feat: Implement Homebrew cask migration with dual distribution Oct 8, 2025
Copy link
Collaborator

@alexluong alexluong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

let's make sure we update the installation instruction accordingly. A few places I have in mind:

Do we embed any instructions anywhere in the dashboard? not 100% sure, just a question so we can check it of the list.

- Comment out homebrew_casks section in .goreleaser/mac.yml
- Remove deprecation warning from formula caveats (formula is now primary)
- Update test script to focus on formula-only testing
- Remove cask-related tests and validations
- Update CI workflow to test only formula distribution
- Enforce Gatekeeper compliance testing (removed bypass flag)

All tests pass including installation validation and binary execution.
Will re-enable cask distribution once Apple Developer certificate is in place.
chore: temporarily disable cask distribution until code signing
@leggetter
Copy link
Collaborator Author

Ok, we've reverted back to only supporting formula installs now because cask installs require signing on mac.

@leggetter leggetter merged commit 5881c10 into main Oct 8, 2025
6 checks passed
@leggetter leggetter deleted the chore/update-goreleaser branch October 8, 2025 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants