-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
29 lines (22 loc) · 956 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
BUILD_VERSION := $(shell cat build_version)
BUILD_DATE := $(shell date '+%Y-%m-%d %H:%M:%S')
COMMIT_SHA1 := $(shell git rev-parse --short HEAD)
VERSION_PKG := github.com/cnlubo/myssh
DEST_DIR := dist
APP := myssh
all:
gox -osarch="darwin/amd64 linux/amd64" \
-output='${DEST_DIR}/${APP}_{{.OS}}_{{.Arch}}' \
-ldflags "-X '${VERSION_PKG}/version.Version=${BUILD_VERSION}' \
-X '${VERSION_PKG}/version.BuildTime=${BUILD_DATE}' \
-X '${VERSION_PKG}/version.GitCommit=${COMMIT_SHA1}'" \
./cmd
release: all
ghr -u cnlubo -t $(GITHUB_RELEASE_TOKEN) -replace -recreate --debug ${BUILD_VERSION} dist
pre-release: all
ghr -u cnlubo -t $(GITHUB_RELEASE_TOKEN) -replace -recreate -prerelease --debug ${BUILD_VERSION} dist
clean:
rm -rf ${DEST_DIR}
.PHONY : all release clean install
.EXPORT_ALL_VARIABLES:
GO111MODULE = on