-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMakefile
38 lines (30 loc) · 853 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
VERSION = $(shell godzil show-version)
CURRENT_REVISION = $(shell git rev-parse --short HEAD)
BUILD_LDFLAGS = "-X github.com/Songmu/goxz.revision=$(CURRENT_REVISION)"
u := $(if $(update),-u)
.PHONY: deps
deps:
go get ${u} -d
go mod tidy
.PHONY: devel-deps
devel-deps: build
go install github.com/Songmu/godzil/cmd/godzil@latest
go install github.com/tcnksm/ghr@latest
.PHONY: test
test: deps
go test
.PHONY: build
build: deps
go build -ldflags=$(BUILD_LDFLAGS) ./cmd/goxz
.PHONY: release
release: devel-deps
godzil release
CREDITS: deps devel-deps go.sum
godzil credits -w
.PHONY: CREDITS crossbuild
crossbuild: devel-deps
./goxz -pv=v$(VERSION) -static -build-ldflags=$(BUILD_LDFLAGS) \
-d=./dist/v$(VERSION) ./cmd/goxz
.PHONY: upload
upload:
ghr -body="$$(godzil changelog --latest -F markdown)" v$(VERSION) dist/v$(VERSION)