简体   繁体   English

如何设置 GoReleaser 将 brew tap 推送到不同的存储库

[英]How to set up GoReleaser to push a brew tap to a different repo

I'm looking to set up a github action script on a private github repo which pushes a release and brew tap to a separate public git repo.我希望在私人 github 存储库上设置一个 github 操作脚本,该脚本将发布和 brew tap 推送到单独的公共 git 存储库。 I've created a .gorelease.yml file and specified a brews section like this:我创建了一个.gorelease.yml文件和指定brews这样的部分:

brews:
- name: myrepo
  goarm: 6
  github:
    owner: myrepo
    name: homebrew-myrepo
  homepage: "https://myrepo.com"

The .gorelease.yml file works fine and successfully builds the binaries. .gorelease.yml文件工作正常并成功构建二进制文件。 I've also specified a github token for the public repository in the github action, so that should work.我还在 github 操作中为公共存储库指定了一个 github 令牌,这样应该就可以了。

When I run the github action, I get this error:当我运行 github 操作时,出现此错误:

   fatal: no tag exactly matches '38d505213e445a673a34812929ff858595e1a887'
   ⚠️ No tag found for commit 38d5052. Snapshot forced
   ...
   • signing artifacts        
      • pipe skipped              error=artifact signing is disabled
   • docker images            
      • pipe skipped              error=docker section is not configured
   • publishing               
      • pipe skipped              error=publishing is disabled
   • release succeeded after 159.12s

What I don't understand why the current git repo is relevant.我不明白为什么当前的 git repo 是相关的。 Because I'm pushing to a separate repo, shouldn't this script be checking the tags on that repo (not the current one)?因为我要推送到一个单独的 repo,所以这个脚本不应该检查那个 repo 上的标签(不是当前的)? And even in this case, how would I automatically create a tag on every push?即使在这种情况下,我如何在每次推送时自动创建标签?

goreleaser uses the semver to figure out the versions so you have to add tag in the format of v1.2.4 goreleaser使用 semver 来计算版本,所以你必须以v1.2.4的格式添加标签

git tag v1.2.4
git push --tags

.goreleaser.yml .goreleaser.yml

brews:
  - github:
      owner: my-repo
      name: homebrew-myrepo
    folder: Formula
    homepage: https://github.com/my-repo/abc

Workflow file工作流文件

    - name: GoReleaser
      uses: goreleaser/goreleaser-action@v2
      with:
        version: latest
        args: release --rm-dist
      env:
        GITHUB_TOKEN: ${{ secrets.GR_TOKEN }}

NOTE: Do not forget to create a new token and add it as a secret in the relevant repository.注意:不要忘记创建一个新令牌并将其作为机密添加到相关存储库中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Github上设置并推送到第二个仓库 - How to set up and push to a second repo on Github 如果我要推送到特定的存储库中,我该如何设置git来警告我? - How do I set up git to warn me if I am about to push to master in a specific repo? 如何从 Bitbucket 存储库推送到 Azure 存储库,不同的用户 email - How to push from Bitbucket repo to a Azure repo, different user email 设置git推送到另一个用户的Github仓库? - Set up git to push to another user's Github repo? 试图建立远程仓库并推送到它,很困惑 - Trying to set up remote repo and push to it, getting confused 如何设置具有不同拉/推上游的分支 - How to set up branches with different pull/push upstreams 如何设置一个repo,以便在克隆时有两个不同的地址用于推送和获取? - How to set up a repo so that when cloned it has two different adresses for pushing and fetching? 如何将本地存储库设置为与开源项目的远程“上游”目录具有不同的根目录? - How to set up local repo to have different root directory than remote “upstream” directory of an open source project? “git push heroku master”如何知道推送到哪里以及如何推送到不同的存储库? - How does "git push heroku master" know where to push to and how to push to a different repo? 如何在一个仓库中将不同的分支推送到不同的远程仓库? - how to push different branches to different remote repos in one repo?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM