From 8028bc8f2638981dd61408beb90ed3452810b913 Mon Sep 17 00:00:00 2001 From: zc Date: Wed, 22 Dec 2021 15:02:02 +0800 Subject: [PATCH] let goreleaser build debug file (#84) --- .goreleaser.yml | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index e97ae79..77d0a2e 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -6,20 +6,50 @@ before: - go mod download builds: - - binary: eru-agent + - id: eru-agent-debug + binary: eru-agent.dbg env: - CGO_ENABLED=0 ldflags: - - -s -w - -X github.com/projecteru2/agent/version.REVISION={{.Commit}} - -X github.com/projecteru2/agent/version.VERSION={{.Env.VERSION}} - -X github.com/projecteru2/agent/version.BUILTAT={{.Date}} + hooks: + post: + - cp {{.Path}} ./eru-agent-{{.Os}}.dbg goos: - darwin - linux goarch: - amd64 + # the best practice is using prebuilt builder + # however it's a Pro feature + - id: eru-agent-linux + binary: eru-agent + hooks: + post: + - cp ./eru-agent-{{.Os}}.dbg {{.Path}} + - strip {{.Path}} + goos: + - linux + goarch: + - amd64 + + - id: eru-agent-darwin + binary: eru-agent + env: + - CGO_ENABLED=0 + ldflags: + - -w -s + - -X github.com/projecteru2/agent/version.REVISION={{.Commit}} + - -X github.com/projecteru2/agent/version.VERSION={{.Env.VERSION}} + - -X github.com/projecteru2/agent/version.BUILTAT={{.Date}} + goos: + - darwin + goarch: + - amd64 + archives: - replacements: darwin: Darwin