-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (32 loc) · 847 Bytes
/
Makefile
File metadata and controls
40 lines (32 loc) · 847 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
VERSION ?= dev
NAME = rodeo
#$(basename $(dir $(abspath "$PWD")))
ORG = acmerocket
HASH = $(shell git describe --always)
RELEASE = $(VERSION)-$(HASH)
PROJECT = github.com/$(ORG)/$(NAME)
GOVARS = -X $(PROJECT)/main.Version=$(VERSION) -X $(PROJECT)/main.VersionHash=$(HASH)
DEBUGVAR = -X -X $(PROJECT)/main.Debug=ON
all: test
tidy:
go mod tidy
go fmt ./...
build: tidy
go build ./...
test: tidy
go test ./...
install: test
go install -v ./...
clean:
go clean ./...
rm -fr .cover.html .cover.out dist/
cover:
go test -v -coverprofile .cover.out ./...
go tool cover -html .cover.out -o .cover.html
#open .cover.html
release: test
git commit -m "$(NAME): releasing version $(VERSION) $(HASH) on $(shell date)"
git push
git tag "$(VERSION)"
git push origin "$(VERSION)"
GOPROXY=proxy.golang.org go list -m "$(PROJECT)@$(VERSION)"