Skip to content

feat: add Homebrew formula and macOS binary releases - #742

Open
sonupreetam wants to merge 2 commits into
complytime:mainfrom
sonupreetam:feat/homebrew-tap
Open

feat: add Homebrew formula and macOS binary releases#742
sonupreetam wants to merge 2 commits into
complytime:mainfrom
sonupreetam:feat/homebrew-tap

Conversation

@sonupreetam

@sonupreetam sonupreetam commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

Add a source-build Homebrew Formula and macOS binary releases for complyctl.

Changes:

  • Add darwin/amd64 and darwin/arm64 to the GoReleaser build matrix
  • Add a "Publish Homebrew formula" step to the release workflow that
    generates a source-build Formula and pushes it to complytime/homebrew-tap
  • Mint a short-lived GitHub App token via actions/create-github-app-token
    for cross-repo push (uses existing APP_ID/PRIVATE_KEY secrets)
  • Fix deprecated archives.formatformats (GoReleaser v2)
  • Document Homebrew and go install as installation methods
  • Include OpenSpec artifacts documenting the architectural decisions

After merge, users install with:

brew install complytime/tap/complyctl

The Formula builds from source on the user's machine (Homebrew auto-installs
Go). This avoids macOS Gatekeeper/signing entirely — no Apple Developer
certificate, no xattr workaround needed.

Related Issues

Review Hints

  • The key design decision (Formula vs Cask) is documented in
    openspec/changes/homebrew-formula-and-go-install/design.md — start there
    for context on why source-build was chosen over pre-built binary distribution.

  • The release workflow's "Publish Homebrew formula" step uses a heredoc to
    template the Ruby Formula file. The YAML indentation is handled by the |
    block scalar (18 spaces stripped by YAML, leaving correct Ruby formatting).

Test results:

  • goreleaser check passes clean (zero deprecation warnings)
  • goreleaser release --snapshot --clean produces all 4 archives
    (darwin/amd64, darwin/arm64, linux/amd64, linux/arm64)
  • darwin/arm64 binary runs locally (complyctl version reports correct metadata)
  • complyctl completion {bash,zsh,fish} generates completions successfully
  • CI passes on this PR
  • First release after merge publishes formula to complytime/homebrew-tap

Important

Admin pre-merge checklist:

  • Verify the GitHub App (APP_ID/PRIVATE_KEY) has Contents: write
    permission on the homebrew-tap repository
  • If the App installation is scoped to specific repos (not all org repos),
    add homebrew-tap to the list

@sonupreetam
sonupreetam requested a review from a team as a code owner July 16, 2026 16:05
@sonupreetam
sonupreetam force-pushed the feat/homebrew-tap branch 2 times, most recently from b28a9ac to b7e8fca Compare July 17, 2026 10:26
@sonupreetam sonupreetam changed the title feat: add Homebrew cask and macOS binary releases feat: add Homebrew formula and macOS binary releases Jul 17, 2026
@sonupreetam
sonupreetam force-pushed the feat/homebrew-tap branch 3 times, most recently from 1adab71 to 53abb4f Compare July 17, 2026 11:29
@sonupreetam

Copy link
Copy Markdown
Member Author

The lint issues are not from this PR. https://github.com/complytime/complyctl/actions/runs/29576984198/job/87873581142?pr=742
PR #750 fixes the error.

@sonupreetam
sonupreetam marked this pull request as draft July 17, 2026 12:19
@sonupreetam
sonupreetam force-pushed the feat/homebrew-tap branch 4 times, most recently from ef14585 to d9b86b2 Compare July 20, 2026 12:20
@sonupreetam
sonupreetam marked this pull request as ready for review July 20, 2026 13:01
@sonupreetam
sonupreetam marked this pull request as draft July 20, 2026 13:08
@sonupreetam
sonupreetam force-pushed the feat/homebrew-tap branch 2 times, most recently from ed7f106 to d9b2d33 Compare July 20, 2026 13:46
@sonupreetam
sonupreetam marked this pull request as ready for review July 20, 2026 14:21
@trevor-vaughan

Copy link
Copy Markdown
Member

Hi @sonupreetam. I'm happy to do an LLM-driven review of this if you like and review the results but I have almost no experience in the Homebrew/Mac ecosystem so I'm not sure I'm the best reviewer for this. Let me know if you'd like me to proceed anyway and happy to do so!

@sonupreetam
sonupreetam requested review from jpower432 and marcusburghardt and removed request for trevor-vaughan and yvonnedevlinrh July 22, 2026 06:34
@sonupreetam

Copy link
Copy Markdown
Member Author

No worries @trevor-vaughan, added @marcusburghardt & @jpower432 as the primary reviewers.

@sonupreetam
sonupreetam force-pushed the feat/homebrew-tap branch 2 times, most recently from 22e6695 to 98c4394 Compare July 30, 2026 10:52
@sonupreetam

Copy link
Copy Markdown
Member Author

@hbraswelrh I would need a re-review on this PR.

@hbraswelrh

Copy link
Copy Markdown
Member

@hbraswelrh I would need a re-review on this PR.

Will do. Thanks, Sonu!

@hbraswelrh hbraswelrh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

PR Review: #742 — feat: add Homebrew formula and macOS binary releases

Well-structured PR. Design decisions documented in OpenSpec ADR. All CI passes.
No runtime code changes — CI/CD, docs, and testing only.

Findings: 1 HIGH (auth header leak risk), 1 MEDIUM (template fragility — informational).
Verdict: COMMENT — no blocking issues, but the HIGH finding merits evaluation before merge.

This review was generated by /review-pr (AI-assisted).

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml
@sonupreetam

Copy link
Copy Markdown
Member Author

Hi @gxmiranda, would you take a look at the pre-merge checklist before this merges?

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
gxmiranda
gxmiranda previously approved these changes Aug 4, 2026

@gxmiranda gxmiranda left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

hbraswelrh
hbraswelrh previously approved these changes Aug 4, 2026

@hbraswelrh hbraswelrh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.

Comment thread docs/RELEASE_PROCESS.md
The `homebrew` job in the release workflow automatically publishes or updates `Formula/complyctl.rb` in the [homebrew-tap](https://github.com/complytime/homebrew-tap) repository.

**Prerequisites:**
- The GitHub App (secrets: `APP_ID_HOMEBREW_FORMULA_PUBLISHER`, `PRIVATE_KEY_APP_HOMEBREW_FORMULA_PUBLISHER`) must have `Contents:write` permission on `complytime/homebrew-tap`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@sonupreetam as discussed this morning the indication of repo-scoped secrets are here

@sonupreetam sonupreetam Aug 4, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@hbraswelrh Did you mean that the docs need to indicate that we would be using the org-level secrets? If so, I would have to add that advisory.

- Add darwin/amd64 and darwin/arm64 to GoReleaser build matrix
- Add Homebrew formula publishing step to release workflow
- Use validated preflight tag (not raw inputs.tag) for homebrew job
- Add explicit if guard on homebrew job matching release job pattern
- Mint short-lived GitHub App token for cross-repo push
- Fix deprecated archives.format -> formats (GoReleaser v2)
- Document Homebrew and go install as installation methods
- Add CHANGELOG entries for macOS binaries, Homebrew formula, go install
- Include OpenSpec artifacts for architectural decisions

Closes complytime#713
Signed-off-by: sonupreetam <spreetam@redhat.com>
Replace deprecated app-id input with client-id in
actions/create-github-app-token. Rename secrets to
descriptive names scoped to the Homebrew publishing use case:

- APP_ID -> secrets.APP_ID_HOMEBREW_FORMULA_PUBLISHER
- PRIVATE_KEY -> secrets.PRIVATE_KEY_APP_HOMEBREW_FORMULA_PUBLISHER

Admin action required: create both secrets in GitHub Settings
before the next release.

Signed-off-by: sonupreetam <spreetam@redhat.com>
@sonupreetam
sonupreetam enabled auto-merge (squash) August 4, 2026 16:07
@sonupreetam
sonupreetam disabled auto-merge August 4, 2026 16:08
@sonupreetam
sonupreetam dismissed stale reviews from hbraswelrh and gxmiranda via 349503d August 4, 2026 16:12
@sonupreetam

Copy link
Copy Markdown
Member Author

@hbraswelrh & @gxmiranda I just rebased and new a re-review.

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.

Publish complyctl on homebrew

5 participants