From f9587e1626717bedb55f795d9873c9c9bdaacc9b Mon Sep 17 00:00:00 2001 From: zc Date: Tue, 21 Dec 2021 15:50:21 +0800 Subject: [PATCH] build once, strip the binary --- .goreleaser.yml | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index b622478e6..bdcc1a934 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -13,14 +13,13 @@ builds: ldflags: - -X github.com/projecteru2/core/version.REVISION={{.Commit}} - -X github.com/projecteru2/core/version.VERSION={{.Env.VERSION}} - - -X github.com/projecteru2/core/version.BUILTAT={{.CommitDate}} - mod_timestamp: "{{ .CommitTimestamp }}" + - -X github.com/projecteru2/core/version.BUILTAT={{.Date}} hooks: post: - - objcopy -S "{{ .Path }}" + - cp "{{ .Path }}" ./eru-core.dbg + - strip "{{ .Path }}" goos: - linux - - darwin goarch: - amd64 @@ -28,20 +27,11 @@ builds: # however it's a Pro feature - id: eru-core-dbg binary: eru-core.dbg - env: - - CGO_ENABLED=0 - ldflags: - - -X github.com/projecteru2/core/version.REVISION={{.Commit}} - - -X github.com/projecteru2/core/version.VERSION={{.Env.VERSION}} - - -X github.com/projecteru2/core/version.BUILTAT={{.CommitDate}} - mod_timestamp: "{{ .CommitTimestamp }}" hooks: post: - - objcopy --only-keep-debug "{{ .Path }}" output/eru-core.dbg - - cp output/eru-core.dbg "{{ .Path }}" + - cp ./eru-core.dbg "{{ .Path }}" goos: - linux - - darwin goarch: - amd64 @@ -68,3 +58,4 @@ changelog: exclude: - '^docs:' - '^test:' +