how to update brew formula when i update the relavant code

213 Views Asked by At

I have created a custom brew formula for go binary. so when I update the main code repo, I need to manually update the homebrew-X formula to change the version or say update the shasum 256 of that. can someone please help how can I update the shasum 256 and version auto?

1

There are 1 best solutions below

0
On

You can automate it with goreleaser help - see brew

here is a configuration example of how it can be used with goreleaser (note it's referring to the private repository).

brews:
  - name: app-cli
    homepage: 'https://github.com/xendit/app-cli'
    description: 'app-cli binary distribution using homebrew.'
    folder: Formula
    download_strategy: GitHubPrivateRepositoryReleaseDownloadStrategy
    custom_require: "lib/private_strategy"
    commit_author:
      name: goreleaserbot
      email: [email protected]
    tap:
      owner: username
      name: app-cli
    install: |
      bin.install "app-cli"

Goreleaser itself can be automated with any ci system.