In .github/workflows/release.yml
file:
- name: run GoReleaser
uses: goreleaser/goreleaser-action@v6
env:
HOMEBREW_TOKEN: ${{ secrets.HOMEBREW_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: release --clean
In .goreleaser.yml
file:
brews:
- name: SomePgm
repository:
owner: MyUser
name: homebrew-tap
token: "{{ .Env.HOMEBREW_TOKEN }}"
commit_author:
name: MyUser
email: MyUser@users.noreply.github.com
homepage: https://github.com/MyUser/MyRepo
description: "a cli program that does something"
test: system "#{bin}/SomePgm -v"
install: bin.install "SomePgm"
- click on repo Settings
- on the left side, click on
Secrets and Variables
and thenActions
(which is hidden until you click Secrets and Variables) - on the right side, clicked the
Secrets
tab - click the
New Repository Secret
button - add a HOMEBREW_TOKEN token