-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
25 lines (19 loc) · 817 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
GOBIN?=$(shell go env GOPATH)/bin
.PHONY: install
install: ## Install tools used by the project
fgrep '_' tools.go | cut -f2 -d' ' | xargs go install
# golangci-lint project doesn't recommend to install from go modules
[ `which $(GOBIN)/golangci-lint` ] || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v1.22.2
build:
go build -o changelog main.go
test:
go test -cover ./...
lint:
$(GOBIN)/golangci-lint run
release: build
./changelog release $(V) -o CHANGELOG.md
.DEFAULT_GOAL:=help
.PHONY: help
help: COLUMN_SIZE=15
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-$(COLUMN_SIZE)s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)