-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (32 loc) · 960 Bytes
/
Copy pathMakefile
File metadata and controls
41 lines (32 loc) · 960 Bytes
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
39
40
41
NAME := dogsitter
ifndef DRONE_TAG
VERSION :=$(shell git describe --abbrev=0 --tags --exact-match 2>/dev/null || git rev-parse --short HEAD)
else
VERSION := $(DRONE_TAG)
endif
LDFLAGS := -w -extldflags "-static" -X 'main.version=$(VERSION)'
ifndef GOBIN
GOBIN = $(GOPATH)/bin
endif
.PHONY: setup
setup:
GO111MODULE=on go get -u -v golang.org/x/lint/golint
GO111MODULE=on go get -u -v github.com/mitchellh/gox
.PHONY: deps
deps:
GO111MODULE=on go mod download
.PHONY: lint
lint:
GO111MODULE=on golint -set_exit_status .
GO111MODULE=on go vet ./...
.PHONY: test
test:
GO111MODULE=on go test -coverprofile=coverage.out -v ./...
.PHONY: build
build:
mkdir -p dist; rm -rf dist/*
CGO_ENABLED=0 GO111MODULE=on gox -osarch "linux/386 linux/amd64 darwin/amd64 darwin/arm64" -ldflags "$(LDFLAGS)" -output dist/$(NAME)_{{.OS}}_{{.Arch}}
strip dist/*_linux_amd64 dist/*_linux_386
.PHONY: release
release:
/usr/local/bin/publish_release.bash