Skip to content

Commit

Permalink
build once, strip the binary
Browse files Browse the repository at this point in the history
  • Loading branch information
jschwinger233 committed Dec 21, 2021
1 parent c9c6ca9 commit f9587e1
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,25 @@ 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

# the best practice is using prebuilt builder
# 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

Expand All @@ -68,3 +58,4 @@ changelog:
exclude:
- '^docs:'
- '^test:'

0 comments on commit f9587e1

Please sign in to comment.