Skip to content

Commit

Permalink
add better build flags
Browse files Browse the repository at this point in the history
  • Loading branch information
atomicptr committed Apr 4, 2020
1 parent 40f70fb commit 2f33c68
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
builds:
- main: ./cmd/crab/main.go
flags:
- -mod=readonly
ldflags:
- -w -extldflags "-static"
- -X github.com/atomicptr/crab/pkg/meta.Version={{.Version}}
- -X github.com/atomicptr/crab/pkg/meta.GitCommit={{.FullCommit}}
env:
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ git_commit := $(shell git rev-list -1 HEAD)
git_version := $(shell git --no-pager tag --points-at HEAD | head -n 1)

build:
go build -mod=readonly \
-o bin/crab \
go build -o bin/crab \
-ldflags "\
-X $(meta_path).Version=$(git_version) \
-X $(meta_path).GitCommit=$(git_commit)" \
Expand Down

0 comments on commit 2f33c68

Please sign in to comment.