# This is an example .goreleaser.yml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
#- go mod tidy
# you may remove this if you don't need go generate
#- go generate ./...
builds:
- env:
- CGO_ENABLED=0
id: "anewproject"
binary: "anew"
goos:
- linux
- windows
- darwin
goarch:
- amd64
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "v1.0.0-snapshot"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
打包
goreleaser --snapshot --skip-publish --rm-dist
这里可能会提示
⨯ release failed after 2.94s error=failed to build for darwin_amd64: go: cannot find main module, but found .git/config in C:\xxx
直接
go mod init hello
再运行一遍就可以了
如果提示一下报错
couldn't guess project_name, please add it to your config