-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathMakefile
25 lines (18 loc) · 851 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
GIT_VER := $(shell git describe --tags)
DATE := $(shell date +%Y-%m-%dT%H:%M:%S%z)
export GO111MODULE := on
.PHONY: test local get-deps binary install clean
cmd/stretcher/stretcher: *.go cmd/stretcher/main.go
cd cmd/stretcher && go build -ldflags "-s -w -X main.version=${GIT_VER} -X main.buildDate=${DATE}" -gcflags="-trimpath=${PWD}"
install: cmd/stretcher/stretcher
install cmd/stretcher/stretcher ${GOPATH}/bin
test:
go test -race
packages:
cd cmd/stretcher && gox -os="linux darwin" -arch="amd64 arm64" -output "../../pkg/{{.Dir}}-${GIT_VER}-{{.OS}}-{{.Arch}}" -ldflags "-w -s -X main.version=${GIT_VER} -X main.buildDate=${DATE}"
cd pkg && find . -name "*${GIT_VER}*" -type f -exec zip {}.zip {} \;
clean:
rm -f cmd/stretcher/stretcher
rm -f pkg/*
release:
ghr -prerelease -u fujiwara -r stretcher -n "$(GIT_VER)" $(GIT_VER) pkg/