From 089fae70041c69a1051dfd520ad7d07ad45794ef Mon Sep 17 00:00:00 2001 From: zc Date: Wed, 22 Dec 2021 15:23:11 +0800 Subject: [PATCH] let goreleaser also build debug file (#519) --- .github/workflows/goreleaser.yml | 2 +- .goreleaser.yml | 34 ++++++++++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index c2c1c1fd2..d3eec01b5 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -21,7 +21,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.17 - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 diff --git a/.goreleaser.yml b/.goreleaser.yml index 747e13207..6f75f0946 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -6,16 +6,46 @@ before: - go mod download builds: - - binary: eru-core + - id: eru-core-debug + binary: eru-core.dbg env: - CGO_ENABLED=0 ldflags: - - -s -w - -X github.com/projecteru2/core/version.REVISION={{.Commit}} - -X github.com/projecteru2/core/version.VERSION={{.Env.VERSION}} - -X github.com/projecteru2/core/version.BUILTAT={{.Date}} + hooks: + post: + - cp {{.Path}} ./eru-core-{{.Os}}.dbg + goos: + - darwin + - linux + goarch: + - amd64 + + # the best practice is using prebuilt builder + # however it's a Pro feature + - id: eru-core-linux + binary: eru-core + hooks: + post: + - cp ./eru-core-{{.Os}}.dbg {{.Path}} + - strip {{.Path}} goos: - linux + goarch: + - amd64 + + - id: eru-core-darwin + binary: eru-core + env: + - CGO_ENABLED=0 + ldflags: + - -w -s + - -X github.com/projecteru2/core/version.REVISION={{.Commit}} + - -X github.com/projecteru2/core/version.VERSION={{.Env.VERSION}} + - -X github.com/projecteru2/core/version.BUILTAT={{.Date}} + goos: - darwin goarch: - amd64