answer/.goreleaser.yaml

105 lines
2.6 KiB
YAML
Raw Normal View History

2022-12-16 18:41:07 +08:00
env:
- GO11MODULE=on
- GO111MODULE=on
- GOPROXY=https://goproxy.io
2023-01-16 17:00:56 +08:00
- CGO_ENABLED=0
2022-12-16 18:41:07 +08:00
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:
2023-01-16 16:28:21 +08:00
- arm64
- id: build-arm7
2022-12-21 10:36:18 +08:00
main: ./cmd/answer/.
binary: answer
ldflags: -s -w -X main.Version={{.Version}} -X main.Revision={{.ShortCommit}} -X main.Time={{.Date}} -X main.BuildUser=goreleaser
env:
- CC=arm-linux-gnueabihf-gcc
- CXX=arm-linux-gnueabihf-g++
- AR=arm-linux-gnueabihf-ar
goos:
- linux
goarch:
- arm
goarm:
- 7
2022-12-16 22:54:12 +08:00
- id: build-darwin-arm64
main: ./cmd/answer/.
binary: answer
env:
- CC=oa64-clang
- CXX=oa64-clang++
goos:
- darwin
goarch:
- arm64
2023-01-16 16:28:21 +08:00
ldflags: -s -w -X main.Version={{.Version}} -X main.Revision={{.ShortCommit}} -X main.Time={{.Date}} -X main.BuildUser=goreleaser
2022-12-16 22:54:12 +08:00
flags: -v
- id: build-darwin-amd64
main: ./cmd/answer/.
binary: answer
env:
- CC=o64-clang
- CXX=o64-clang++
goos:
- darwin
goarch:
- amd64
2023-01-16 16:28:21 +08:00
ldflags: -s -w -X main.Version={{.Version}} -X main.Revision={{.ShortCommit}} -X main.Time={{.Date}} -X main.BuildUser=goreleaser
2022-12-16 22:54:12 +08:00
flags: -v
2022-12-16 18:41:07 +08:00
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:'
2023-01-16 16:28:21 +08:00
# sudo apt-get install build-essential
2022-12-16 17:16:27 +08:00
# 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
2023-01-16 16:28:21 +08:00
# goreleaser release --snapshot --rm-dist