answer/.goreleaser.yaml

97 lines
2.5 KiB
YAML
Raw Normal View History

2022-12-16 18:41:07 +08:00
env:
- GO11MODULE=on
- GO111MODULE=on
- GOPROXY=https://goproxy.io
- CGO_ENABLED=1
2022-12-16 13:24:45 +08:00
before:
hooks:
- go mod tidy
builds:
2022-12-16 17:16:27 +08:00
- id: build-amd64
2022-12-16 17:08:56 +08:00
main: ./cmd/answer/.
2022-12-16 17:16:27 +08:00
binary: answer
2022-12-16 17:27:41 +08:00
ldflags: -s -w -X main.Version={{.Version}} -X main.Revision={{.ShortCommit}} -X main.Time={{.Date}} -X main.BuildUser=goreleaser
2022-12-16 17:08:56 +08:00
goos:
- linux
goarch:
- amd64
# linux windows need cgomingw64-gcc
- id: build-windows
main: ./cmd/answer/.
2022-12-16 17:16:27 +08:00
binary: answer
2022-12-16 17:27:41 +08:00
ldflags: -s -w -X main.Version={{.Version}} -X main.Revision={{.ShortCommit}} -X main.Time={{.Date}} -X main.BuildUser=goreleaser
2022-12-16 17:08:56 +08:00
env:
- CC=x86_64-w64-mingw32-gcc
- CXX=x86_64-w64-mingw32-g++
goos:
- windows
goarch:
- amd64
# linux arm64 need cgo arm64
2022-12-16 17:16:27 +08:00
- id: build-arm64
2022-12-16 17:08:56 +08:00
main: ./cmd/answer/.
2022-12-16 17:16:27 +08:00
binary: answer
2022-12-16 17:27:41 +08:00
ldflags: -s -w -X main.Version={{.Version}} -X main.Revision={{.ShortCommit}} -X main.Time={{.Date}} -X main.BuildUser=goreleaser
2022-12-16 17:08:56 +08:00
env:
2022-12-16 13:24:45 +08:00
- CC=aarch64-linux-gnu-gcc
- CXX=aarch64-linux-gnu-g++
goos:
- linux
2022-12-16 17:08:56 +08:00
goarch:
- arm64
2022-12-16 19:26:32 +08:00
# - id: darwin
# main: ./cmd/answer/.
# binary: answer
# goos:
# - darwin
# ldflags: -s -w -X main.Version={{.Version}} -X main.Revision={{.ShortCommit}} -X main.Time={{.Date}} -X main.BuildUser=goreleaser
#todo
2022-12-16 18:41:07 +08:00
# - id: darwin-arm64
# main: ./cmd/answer/.
# binary: answer
2022-12-16 19:26:32 +08:00
# env:
# - CC=oa64-clang
# - CXX=oa64-clang++
2022-12-16 18:41:07 +08:00
# goos:
# - darwin
# goarch:
# - arm64
2022-12-16 19:26:32 +08:00
# ldflags: -s -w -X main.Version={{.Version}} -X main.Revision={{.ShortCommit}} -X main.Time={{.Date}} -X main.BuildUser=goreleaser
2022-12-16 18:41:07 +08:00
# flags: -v
# - id: darwin-amd64
# main: ./cmd/answer/.
# binary: answer
2022-12-16 19:26:32 +08:00
# env:
# - CC=o64-clang
# - CXX=o64-clang++
2022-12-16 18:41:07 +08:00
# goos:
# - darwin
# goarch:
2022-12-16 19:26:32 +08:00
# - amd64
# ldflags: -s -w -X main.Version={{.Version}} -X main.Revision={{.ShortCommit}} -X main.Time={{.Date}} -X main.BuildUser=goreleaser
2022-12-16 18:41:07 +08:00
# flags: -v
2022-12-16 17:08:56 +08:00
2022-12-16 13:24:45 +08:00
archives:
- replacements:
2022-12-16 17:08:56 +08:00
darwin: Darwin
2022-12-16 13:24:45 +08:00
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
2022-12-16 17:16:27 +08:00
- '^test:'
# sudo apt-get install build-essential
# sudo apt-get install gcc-multilib g++-multilib
# sudo apt-get install gcc-mingw-w64
2022-12-16 18:41:07 +08:00
# sudo apt-get -y install gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf
# sudo apt-get install clang llvm
2022-12-16 17:16:27 +08:00
# goreleaser release --snapshot --rm-dist