当你更新相关代码时,如何更新brew公式?

huangapple go评论84阅读模式
英文:

how to update brew formula when i update the relavant code

问题

我已经为Go二进制文件创建了一个自定义的Homebrew公式。所以当我更新主代码仓库时,我需要手动更新homebrew-X公式来更改版本或更新shasum 256。请问有人可以帮忙解决如何自动更新shasum 256和版本吗?

英文:

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

得分: 1

你可以使用goreleaser的帮助来自动化它- 参见brew

这是一个配置示例,展示了如何在goreleaser中使用它(请注意,它引用了私有存储库)。

brews:
  - name: app-cli
    homepage: 'https://github.com/xendit/app-cli'
    description: 'app-cli二进制发布使用homebrew。'
    folder: Formula
    download_strategy: GitHubPrivateRepositoryReleaseDownloadStrategy
    custom_require: "lib/private_strategy"
    commit_author:
      name: goreleaserbot
      email: goreleaser@xendit.co
    tap:
      owner: username
      name: app-cli
    install: |
            bin.install "app-cli"

Goreleaser本身可以与任何CI系统自动化。

英文:

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: goreleaser@xendit.co
    tap:
      owner: username
      name: app-cli
    install: |
      bin.install "app-cli"

Goreleaser itself can be automated with any ci system.

huangapple
  • 本文由 发表于 2021年12月16日 20:15:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/70378862.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定