-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
31 lines (23 loc) · 1.06 KB
/
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
BUILD_VERSION := $(shell cat version)
BUILD_DATE := $(shell date "+%F %T")
COMMIT_SHA1 := $(shell git rev-parse HEAD)
all: clean
gox -osarch="darwin/amd64 linux/386 linux/amd64" \
-output="dist/{{.Dir}}_{{.OS}}_{{.Arch}}" \
-ldflags "-X 'github.com/ytpay/dnsctl/cmd.Version=${BUILD_VERSION}' \
-X 'github.com/ytpay/dnsctl/cmd.BuildDate=${BUILD_DATE}' \
-X 'github.com/ytpay/dnsctl/cmd.CommitID=${COMMIT_SHA1}'"
release: all
ghr -u ytpay -t $(GITHUB_TOKEN) -replace -recreate --debug ${BUILD_VERSION} dist
pre-release: all
ghr -u ytpay -t $(GITHUB_TOKEN) -replace -recreate -prerelease --debug ${BUILD_VERSION} dist
clean:
rm -rf dist
install:
go install -ldflags "-X 'github.com/ytpay/dnsctl/cmd.Version=${BUILD_VERSION}' \
-X 'github.com/ytpay/dnsctl/cmd.BuildDate=${BUILD_DATE}' \
-X 'github.com/ytpay/dnsctl/cmd.CommitID=${COMMIT_SHA1}'"
.PHONY: all release pre-release clean install
.EXPORT_ALL_VARIABLES:
GO111MODULE = on
GOPROXY = https://goproxy.cn