forked from kevinburke/hostsfile
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (31 loc) · 924 Bytes
/
Makefile
File metadata and controls
45 lines (31 loc) · 924 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
42
43
44
45
.PHONY: test release
SHELL = /bin/bash -o pipefail
GOBIN := $(shell go env GOPATH)/bin
BUMP_VERSION := $(GOBIN)/bump_version
STATICCHECK := $(GOBIN)/staticcheck
RELEASE := $(GOBIN)/github-release
WRITE_MAILMAP := $(GOBIN)/write_mailmap
UNAME := $(shell uname)
test:
go test ./...
$(STATICCHECK):
go install honnef.co/go/tools/cmd/staticcheck@latest
$(BUMP_VERSION):
go install github.com/kevinburke/bump_version@latest
$(RELEASE):
go install github.com/aktau/github-release@latest
$(WRITE_MAILMAP):
go install github.com/kevinburke/write_mailmap@latest
force: ;
AUTHORS.txt: force | $(WRITE_MAILMAP)
$(WRITE_MAILMAP) > AUTHORS.txt
authors: AUTHORS.txt
lint: | $(STATICCHECK)
$(STATICCHECK) ./...
go vet ./...
race-test: lint
go test -race ./...
# Run "GITHUB_TOKEN=my-token make release version=0.x.y" to release a new version.
release: race-test
$(BUMP_VERSION) minor cmd.go
git push origin --tags