-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (32 loc) · 903 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
30
31
32
33
34
35
36
37
38
39
40
41
# Makefile
NO_COLOR=\033[0m
OK_COLOR=\033[32;01m
ERROR_COLOR=\033[31;01m
WARN_COLOR=\033[33;01m
ATTN_COLOR=\033[33;01m
#
.PHONY: all
all: deps gen build lint test
deps:
@echo "$(WARN_COLOR)==> deps $(NO_COLOR)"
@go install gotest.tools/[email protected]
@go install github.com/golangci/golangci-lint/cmd/[email protected]
@go install github.com/goreleaser/[email protected]
gen:
@echo "$(ATTN_COLOR)==> generate$(NO_COLOR)"
@go generate ./...
build:
@echo "$(WARN_COLOR)==> build @GOOS=$(GOOS) GOARCH=$(GOARCH) $(NO_COLOR)"
@goreleaser build --single-target --snapshot --rm-dist
clean:
@echo "$(WARN_COLOR)==> clean $(BIN_DIR) $(NO_COLOR)"
@rm -rf ./dist
lint:
@echo "$(ATTN_COLOR)==> Lint $(NO_COLOR)"
@golangci-lint run
test:
@echo "$(WARN_COLOR)==> test $(NO_COLOR)"
@gotestsum ./...
release:
@echo "$(WARN_COLOR)==> release $(NO_COLOR)"
@goreleaser release --rm-dist