Skip to content

Commit

Permalink
Update build ldflags
Browse files Browse the repository at this point in the history
  • Loading branch information
iyangsj committed Apr 21, 2021
1 parent bca29de commit 216e8c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ project_name: bfe
builds:
- binary: bfe
main: ./bfe.go
ldflags:
- -X main.version={{.Version}} -X main.commit={{.Commit}}
- -extldflags=-static
goos:
- linux
- darwin
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ prepare-gen:
# make compile, go build
compile: test build
build:
$(GOBUILD) -ldflags "-X main.version=$(BFE_VERSION) -X main.commit=$(GIT_COMMIT)"
$(GOBUILD) -ldflags "-X main.version=$(BFE_VERSION) -X main.commit=$(GIT_COMMIT) -extldflags=-static"

# make test, test your code
test: test-case vet-case
Expand Down

0 comments on commit 216e8c1

Please sign in to comment.