Skip to content

feat: add Homebrew tap support for automated formula publishing#1086

Merged
looplj merged 1 commit intolooplj:release/v0.9.xfrom
cikichen:feat/homebrew-release
Mar 17, 2026
Merged

feat: add Homebrew tap support for automated formula publishing#1086
looplj merged 1 commit intolooplj:release/v0.9.xfrom
cikichen:feat/homebrew-release

Conversation

@cikichen
Copy link
Copy Markdown
Contributor

@cikichen cikichen commented Mar 17, 2026

Closes #1076

Summary

Add Homebrew tap support for automated formula publishing to looplj/homebrew-axonhub.

Changes

  • .goreleaser.yml: Add brews configuration for automatic formula publishing on release
  • .github/workflows/release.yml: Add HOMEBREW_TAP_GITHUB_TOKEN env var to GoReleaser step

Homebrew Formula Features

  • Binary installed to libexec/, wrapper script in bin/
  • Config directory: /opt/homebrew/etc/axonhub/
  • Zero-config: AxonHub runs with built-in defaults
  • Support brew services for background service management
  • Include axonhub version test

Installation (after merge)

brew tap looplj/axonhub
brew install axonhub

Setup Required: Create HOMEBREW_TAP_GITHUB_TOKEN

GoReleaser needs a token with read/write permissions to looplj/homebrew-axonhub repository to push formula updates automatically.

Step 1: Create Personal Access Token

  1. Go to https://github.com/settings/personal-access-tokens/new (Fine-grained token)
  2. Token name: HOMEBREW_TAP_GITHUB_TOKEN
  3. Expiration: Choose appropriate duration
  4. Resource owner: looplj
  5. Repository access: Select "Only select repositories", then choose looplj/homebrew-axonhub
  6. Permissions:
    • Repository permissions -> Contents: Read and write
    • (This grants read/write access to the repository contents, allowing GoReleaser to push formula commits)
  7. Generate and copy the token

Alternatively, use a Classic token:

  1. Go to https://github.com/settings/tokens/new
  2. Select scope: repo (Full control of private repositories)
  3. This grants read/write access to all repositories, so Fine-grained token is recommended

Step 2: Add to Repository Secrets

  1. Go to https://github.com/looplj/axonhub/settings/secrets/actions
  2. Click "New repository secret"
  3. Name: HOMEBREW_TAP_GITHUB_TOKEN
  4. Value: paste the token
  5. Save

Step 3: Verify

After merging, create a new release tag (e.g., v0.9.18):

  1. Release workflow runs GoReleaser
  2. GoReleaser builds binaries and archives
  3. GoReleaser uses HOMEBREW_TAP_GITHUB_TOKEN to push formula to looplj/homebrew-axonhub
  4. Users can brew install looplj/axonhub/axonhub

Note: If HOMEBREW_TAP_GITHUB_TOKEN is not configured, GoReleaser falls back to GITHUB_TOKEN, which only has permissions to the current repository and cannot push to looplj/homebrew-axonhub.

Test Plan

  • Full GoReleaser + Homebrew publish workflow tested on fork
  • brew tap + brew install axonhub verified
  • axonhub version runs correctly
  • Zero-config startup verified

Related PR

- Add Homebrew brews configuration to .goreleaser.yml
- Configure automatic formula publishing to looplj/homebrew-axonhub
- Add HOMEBREW_TAP_GITHUB_TOKEN to release workflow
- Install binary to libexec with wrapper script in bin
- Create config directory at /opt/homebrew/etc/axonhub
- Support brew services for background service management
- AxonHub runs with built-in defaults, no config file required
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces comprehensive support for automated Homebrew formula publishing for the axonhub project. By integrating GoReleaser with a dedicated Homebrew tap, it streamlines the release process, allowing users to easily install axonhub via brew install. The changes ensure a robust and user-friendly installation experience, including zero-config defaults and brew services integration.

Highlights

  • Homebrew Tap Support: Implemented automated Homebrew formula publishing for axonhub to looplj/homebrew-axonhub.
  • GoReleaser Configuration: Configured .goreleaser.yml to define the Homebrew formula, including installation steps, service integration, and test commands.
  • GitHub Actions Integration: Integrated HOMEBREW_TAP_GITHUB_TOKEN into the release workflow to enable cross-repository publishing.
  • Homebrew Formula Features: The formula now installs the binary to libexec/, sets up a wrapper script in bin/, creates a config directory at /opt/homebrew/etc/axonhub/, supports brew services, and includes an axonhub version test.
Changelog
  • .gitignore
    • Added .snow/ to the list of ignored files.
  • .goreleaser.yml
    • Introduced a new brews section to define the Homebrew formula for axonhub.
    • Configured the HOMEBREW_TAP_GITHUB_TOKEN environment variable for authentication when pushing formula updates.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/release.yml
Activity
  • The author, cikichen, has thoroughly tested the full GoReleaser and Homebrew publish workflow on a fork.
  • Verified that brew tap and brew install axonhub work as expected.
  • Confirmed that axonhub version runs correctly.
  • Ensured zero-config startup functionality.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds Homebrew tap support for automated formula publishing, which is a great feature for distributing the application. The GoReleaser configuration for the Homebrew formula is well-structured. I've suggested a small improvement to the service block definition to make it more direct and idiomatic for Homebrew services. Overall, this is a solid implementation.

Comment on lines +102 to +103
run [opt_bin/"axonhub"]
keep_alive true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

For brew services, it's cleaner and more efficient to run the binary directly from libexec and explicitly set the working_dir, rather than relying on the shell wrapper from bin. The wrapper is great for interactive use, but the service definition can be more direct. This avoids the overhead of a shell process and makes the service's execution context clearer.

      run libexec/"axonhub"
      working_dir etc/"axonhub"
      keep_alive true

@looplj
Copy link
Copy Markdown
Owner

looplj commented Mar 17, 2026

这个可以合了吗,需要我配置什么吗

@looplj looplj merged commit f8b59f5 into looplj:release/v0.9.x Mar 17, 2026
2 checks passed
@cikichen
Copy link
Copy Markdown
Contributor Author

这个可以合了吗,需要我配置什么吗

主要是要加个TOKEN

@cikichen
Copy link
Copy Markdown
Contributor Author

cikichen commented Mar 18, 2026

这个可以合了吗,需要我配置什么吗

@looplj
GoReleaser 需要一个具有读写权限的令牌,以便自动推送更新到 looplj/homebrew-axonhub 仓库。

步骤一:创建个人访问令牌
前往 https://github.com/settings/personal-access-tokens/new(Fine-grained token)
令牌名称:HOMEBREW_TAP_GITHUB_TOKEN
有效期:选择合适期限
资源所有者:looplj
仓库访问权限:选择“仅选定仓库”,然后选中 looplj/homebrew-axonhub
权限设置:
仓库权限 -> 内容:读取和写入
生成并复制令牌

或者使用经典令牌:
前往 https://github.com/settings/tokens/new
选择作用域:repo(完全控制私有仓库)
这将授予对所有仓库的读写权限,因此推荐使用Fine-grained token

步骤二:添加到仓库密钥库中
前往 https://github.com/looplj/axonhub/settings/secrets/actions
点击“新建存储库密钥”
名称输入: HOMEBREW_TAP_GITHUB_TOKEN
值粘贴: 复制的令牌内容
保存

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.

[Feature/功能]: 建议增加 Homebrew 安装方式

2 participants