我有一个项目,我正在尝试使用GitHub动作来设置放线器。但我发现了一个错误:
GoReleaser latest installed successfully v0.1.0 tag found for commit '96480db'
/opt/hostedtoolcache/goreleaser-action/1.10.2/x64/goreleaser release --rm-dist
•starting release...
• loading config file file=.goreleaser.yml
⨯release failed after 0serror=yaml: line 26: did not find expected key
Error: The process '/opt/hostedtoolcache/goreleaser-action/1.10.2/x64/goreleaser' failed with exit code 1.goreleaser.yml
before:
hooks:
- go mod tidy
builds:
- main: cmd/gsolc-select/main.go
binary: gsolc-select
id: gsolc-select-cli
env:
- CGO_ENABLED=0
goos: [ windows,linux,darwin ]
goarch: [ amd64,386,arm,arm64 ]
ignore:
- goos: darwin
goarch: 386
- goos: windows
goarch: arm
- goos: windows
goarch: arm64
flags:
- -trimpath
- main: cmd/solc/main.go
binary: solc
id: solc
env:
- CGO_ENABLED=0
goos: [ windows,linux,darwin ]
goarch: [ amd64,386,arm,arm64 ]
ignore:
- goos: darwin
goarch: 386
- goos: windows
goarch: arm
- goos: windows
goarch: arm64
archives:
- format: zip
id: gsolc-select
builds: [ gsolc-select-cli ]
replacements:
darwin: macOS
- format: zip
id: solc
builds: [ solc ]
replacements:
darwin: macOS
checksum:
algorithm: sha256.github/workflows/release.yml
name: Release Binary
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: 1.18
- uses: goreleaser/goreleaser-action@v3
with:
args: "release --rm-dist"
version: latest
workdir: .
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"据我了解,github本身提供了secrets.GITHUB_TOKEN值。我尝试通过设置 -> ->添加一个自定义令牌(环境变量),但错误是相同的。我不知道我做错了什么。
发布于 2022-07-15 11:46:59
您的gorelease.yml文件有不同的缩进问题。
我不熟悉GoReleaser,错误消息也没有帮助,但我使用的工具如下:
goreleaser check还返回该消息。我注意到这个街区:
goos: [ windows,linux,darwin ]
goarch: [ amd64,386,arm,arm64 ]
ignore:
- goos: darwin
goarch: 386
- goos: windows
goarch: arm
- goos: windows
goarch: arm64相反,应该是这样:
goos: [ windows,linux,darwin ]
goarch: [ amd64,386,arm,arm64 ]
ignore:
- goos: darwin
goarch: 386
- goos: windows
goarch: arm
- goos: windows
goarch: arm64另一个街区:
- format: zip
id: solc
builds: [ solc ]
replacements:
darwin: macOS相反,应该是这样:
- format: zip
id: solc
builds: [ solc ]
replacements:
darwin: macOS修正压痕应该解决这个问题。此外,由于它似乎与Github操作工作流配置无关,它应该允许工作流按预期运行。
https://stackoverflow.com/questions/72985886
复制相似问题