update goreleaser

This commit is contained in:
aichy 2022-12-16 22:54:12 +08:00
parent 88e745c1d7
commit c63fcf1dc9
2 changed files with 33 additions and 31 deletions

View File

@ -40,37 +40,30 @@ builds:
- linux
goarch:
- arm64
# - 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
# - id: darwin-arm64
# main: ./cmd/answer/.
# binary: answer
# env:
# - CC=oa64-clang
# - CXX=oa64-clang++
# goos:
# - darwin
# goarch:
# - arm64
# ldflags: -s -w -X main.Version={{.Version}} -X main.Revision={{.ShortCommit}} -X main.Time={{.Date}} -X main.BuildUser=goreleaser
# flags: -v
# - id: darwin-amd64
# main: ./cmd/answer/.
# binary: answer
# env:
# - CC=o64-clang
# - CXX=o64-clang++
# goos:
# - darwin
# goarch:
# - amd64
# ldflags: -s -w -X main.Version={{.Version}} -X main.Revision={{.ShortCommit}} -X main.Time={{.Date}} -X main.BuildUser=goreleaser
# flags: -v
- id: build-darwin-arm64
main: ./cmd/answer/.
binary: answer
env:
- CC=oa64-clang
- CXX=oa64-clang++
goos:
- darwin
goarch:
- arm64
ldflags: -s -w -X main.Version={{.Version}} -X main.Revision={{.ShortCommit}} -X main.Time={{.Date}} -X main.BuildUser=goreleaser
flags: -v
- id: build-darwin-amd64
main: ./cmd/answer/.
binary: answer
env:
- CC=o64-clang
- CXX=o64-clang++
goos:
- darwin
goarch:
- amd64
ldflags: -s -w -X main.Version={{.Version}} -X main.Revision={{.ShortCommit}} -X main.Time={{.Date}} -X main.BuildUser=goreleaser
flags: -v
archives:

9
script/build_binary.sh Normal file
View File

@ -0,0 +1,9 @@
docker run \
--rm \
-e CGO_ENABLED=1 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/github.com/answerdev/answer \
-v `pwd`/sysroot:/sysroot \
-w /go/src/github.com/answerdev/answer \
goreleaser/goreleaser-cross \
--rm-dist --skip-validate --skip-publish