goreleaser init • Generating .goreleaser.yaml file • config created; please edit accordingly to your needs file=.goreleaser.yaml
自行按下文中GOOS&GOARCH 参照表配置
以下为我的配置
# This is an example .goreleaser.yml file with some sensible defaults. # Make sure to check the documentation at https://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 goos: - linux - windows - darwin goarch: - amd64 - arm archives: - replacements: darwin: Darwin linux: Linux windows: Windows 386: i386 amd64: x86_64 checksum: name_template: 'checksums.txt' snapshot: name_template: "{{ incpatch .Version }}-next" changelog: sort: asc filters: exclude: - '^docs:' - '^test:'
打包
执行
goreleaser release --snapshot --rm-dist
公司的小垃机Cpu直接100%…
成功
• release succeeded after 8.02s
问题解决
release failed after 7.30s error=failed to build for linux_386: exit status 2: # github.com/pingcap/parser/mysql
goreleaser release --snapshot --rm-dist • releasing... • loading config file file=.goreleaser.yaml • loading environment variables • getting and validating git state • ignoring errors because this is a snapshot error=git doesn't contain any tags. Either add a tag or use --snapshot • building... commit=ca535cb8fe0bc89594b98ec81381a44bb8a9a395 latest tag=v0.0.0 • pipe skipped error=disabled during snapshot mode • parsing tag • running before hooks • running hook=go mod tidy • setting defaults • snapshotting • building snapshot... version=0.0.1-next • checking distribution directory • --rm-dist is set, cleaning it up • loading go mod information • build prerequisites • writing effective config file • writing config=dist\config.yaml • building binaries • building binary=dist\bsc-scan_linux_386\bsc-scan • building binary=dist\bsc-scan_linux_amd64\bsc-scan • building binary=dist\bsc-scan_linux_arm64\bsc-scan ⨯ release failed after 7.30s error=failed to build for linux_386: exit status 2: # github.com/pingcap/parser/mysql C:\Users\axin\go\pkg\mod\github.com\pingcap\parser@v0.0.0-20210415081931-48e7f467fd74\mysql\const.go:421:2: constant 2147483648 overflows SQLMode C:\Users\axin\go\pkg\mod\github.com\pingcap\parser@v0.0.0-20210415081931-48e7f467fd74\mysql\const.go:422:2: constant 4294967296 overflows SQLMode C:\Users\axin\go\pkg\mod\github.com\pingcap\parser@v0.0.0-20210415081931-48e7f467fd74\mysql\util.go:44:19: constant 4294967295 overflows int C:\Users\axin\go\pkg\mod\github.com\pingcap\parser@v0.0.0-20210415081931-48e7f467fd74\mysql\util.go:45:19: constant 4294967295 overflows int