diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index af4f2adca..3f169b364 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -373,6 +373,7 @@ jobs: env: GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} GH_PAT_WINGET: ${{ secrets.GH_PAT_WINGET }} + HOMEBREW_ACTION_TRIGGER_TOKEN: ${{ secrets.HOMEBREW_ACTION_TRIGGER_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GITHUB_TOKEN is limited to the current repository DISCORD_WEBHOOK_ID: ${{ secrets.DISCORD_WEBHOOK_ID }} DISCORD_WEBHOOK_TOKEN: ${{ secrets.DISCORD_WEBHOOK_TOKEN }} @@ -415,13 +416,16 @@ jobs: event-type: cli-autodoc client-payload: '{"version": "${{ github.ref_name }}"}' - - name: Trigger Homebrew Formula Update - uses: peter-evans/repository-dispatch@v3 - with: - token: ${{ secrets.HOMEBREW_ACTION_TRIGGER_TOKEN }} - repository: DefangLabs/homebrew-defang - event-type: update-homebrew-formula - client-payload: '{"version": "${{ github.ref_name }}"}' + # NOTE: Homebrew formula updates are now handled automatically by GoReleaser with bottles. + # The manual trigger below is preserved as documentation of the old approach but is no longer needed. + # It can be safely removed in a future cleanup. + # - name: Trigger Homebrew Formula Update + # uses: peter-evans/repository-dispatch@v3 + # with: + # token: ${{ secrets.HOMEBREW_ACTION_TRIGGER_TOKEN }} + # repository: DefangLabs/homebrew-defang + # event-type: update-homebrew-formula + # client-payload: '{"version": "${{ github.ref_name }}"}' - name: Checkout tag uses: actions/checkout@v4 diff --git a/src/.goreleaser.yml b/src/.goreleaser.yml index b715a3354..eb9cc1985 100644 --- a/src/.goreleaser.yml +++ b/src/.goreleaser.yml @@ -110,6 +110,28 @@ release: # --zsh <($out/bin/defang completion zsh) \ # --fish <($out/bin/defang completion fish) +brews: + - repository: + owner: DefangLabs + name: homebrew-defang + token: "{{ .Env.HOMEBREW_ACTION_TRIGGER_TOKEN }}" + name: defang + homepage: https://defang.io + description: Command-line interface for the Defang Opinionated Platform + license: MIT + commit_author: + name: defang-bot + email: bot@defang.io + install: | + bin.install "defang" + + # Generate and install shell completions + bash_completion.install Utils.safe_popen_read(bin/"defang", "completion", "bash") => "defang" + zsh_completion.install Utils.safe_popen_read(bin/"defang", "completion", "zsh") => "_defang" + fish_completion.install Utils.safe_popen_read(bin/"defang", "completion", "fish") => "defang.fish" + test: | + system "#{bin}/defang", "--version" + changelog: use: github-native filters: