tag version
This commit is contained in:
parent
ef583c159f
commit
be668f21e8
21
Makefile
21
Makefile
@ -1,16 +1,21 @@
|
|||||||
GODEPS = $(shell git ls-files '*.go' go.mod go.sum)
|
GODEPS = $(shell git ls-files '*.go' go.mod go.sum)
|
||||||
GOBIN = $(shell go env GOPATH)/bin/
|
GOBIN = $(shell go env GOPATH)/bin/
|
||||||
|
|
||||||
GOOSARCHS = linux/amd64 \
|
GOOSARCHS = $(sort \
|
||||||
linux/arm64 \
|
linux/amd64 \
|
||||||
darwin/amd64 \
|
linux/arm64 \
|
||||||
darwin/arm64 \
|
darwin/amd64 \
|
||||||
windows/amd64/.exe
|
darwin/arm64 \
|
||||||
|
windows/amd64/.exe \
|
||||||
|
)
|
||||||
|
|
||||||
|
VERSION = $(shell git describe --dirty)
|
||||||
|
LDFLAGS = -ldflags "-X main.Version=$(VERSION)"
|
||||||
|
|
||||||
define undockertarget
|
define undockertarget
|
||||||
UNDOCKERS += undocker-$(1)-$(2)$(firstword $(3))
|
UNDOCKERS += undocker-$(1)-$(2)-$(VERSION)-$(firstword $(3))
|
||||||
undocker-$(1)-$(2)$(firstword $(3)): $(GODEPS)
|
undocker-$(1)-$(2)-$(VERSION)$(firstword $(3)): $(GODEPS)
|
||||||
CGO_ENABLED=0 GOOS=$(1) GOARCH=$(2) go build -o $$@
|
CGO_ENABLED=0 GOOS=$(1) GOARCH=$(2) go build $(LDFLAGS) -o $$@
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(foreach goosarch,$(GOOSARCHS),\
|
$(foreach goosarch,$(GOOSARCHS),\
|
||||||
|
Loading…
Reference in New Issue
Block a user