update goreleaser

This commit is contained in:
aichy 2022-12-16 17:08:56 +08:00
parent 4b31951317
commit a43224ec85
1 changed files with 33 additions and 18 deletions

View File

@ -1,20 +1,45 @@
# 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
builds:
- env:
- CGO_ENABLED=1
- id: build-linux
main: ./cmd/answer/.
binary: PrometheusAlert
ldflags: -s -w -X main.Version=${{.Version}} -X main.Revision={{.ShortCommit}} -X main.BuildDate={{.Date}} -X main.BuildUser=goreleaser
goos:
- darwin
- linux
goarch:
- amd64
# linux windows need cgomingw64-gcc
- id: build-windows
main: ./cmd/answer/.
binary: PrometheusAlert
ldflags: -s -w -X main.Version=${{.Version}} -X main.Revision={{.ShortCommit}} -X main.BuildDate={{.Date}} -X main.BuildUser=goreleaser
env:
- CC=x86_64-w64-mingw32-gcc
- CXX=x86_64-w64-mingw32-g++
goos:
- windows
goarch:
- amd64
# linux arm64 need cgo arm64
- id: build-arm
main: ./cmd/answer/.
binary: PrometheusAlert
ldflags: -s -w -X main.Version=${{.Version}} -X main.Revision={{.ShortCommit}} -X main.BuildDate={{.Date}} -X main.BuildUser=goreleaser
env:
- CC=aarch64-linux-gnu-gcc
- CXX=aarch64-linux-gnu-g++
main: ./cmd/answer/.
goos:
- darwin
- linux
goarch:
- arm64
archives:
- replacements:
linux: Linux
darwin: Darwin
amd64: x86_64
checksum:
name_template: 'checksums.txt'
@ -25,14 +50,4 @@ changelog:
filters:
exclude:
- '^docs:'
- '^test:'
# modelines, feel free to remove those if you don't want/use them:
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
# sqlite3 need cgo to build
# sudo apt-get install build-essential
# sudo apt-get install gcc-multilib g++-multilib
# sudo apt-get install gcc-mingw-w64
# sudo apt-get -y install gcc-aarch64-linux-gnu
# goreleaser release --snapshot --rm-dist
- '^test:'