-
Notifications
You must be signed in to change notification settings - Fork 83
/
Makefile
61 lines (45 loc) · 1.31 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
export GOBIN := $(PWD)/bin
export PATH := $(GOBIN):$(PATH)
export GOFLAGS := -mod=mod
GORELEASER_VERSION := "v1.25.0"
UNAME_S := $(shell uname -s)
UNAME_P := $(shell uname -p)
UNAME_M := $(shell uname -m)
GORELEASER_URL := "https://github.com/goreleaser/goreleaser/releases/download/$(GORELEASER_VERSION)/goreleaser_$(UNAME_S)_$(UNAME_P).tar.gz"
./bin:
mkdir ./bin
./bin/gowrap: ./bin
go install ./cmd/gowrap
./bin/golangci-lint: ./bin
go install -modfile tools/go.mod github.com/golangci/golangci-lint/cmd/golangci-lint
./bin/goreleaser:
curl -L $(GORELEASER_URL) -o ./bin/goreleaser.tar.gz
@tar -xvf ./bin/goreleaser.tar.gz -C ./bin
@touch ./bin/goreleaser
./bin/minimock: ./bin
go install -modfile tools/go.mod github.com/gojuno/minimock/v3/cmd/minimock
.PHONY:
lint: ./bin/golangci-lint
./bin/golangci-lint run --enable=goimports --disable=unused --exclude=S1023,"Error return value" ./...
.PHONY:
test:
go test -race -v ./...
.PHONY:
generate: ./bin/gowrap ./bin/minimock
go generate ./...
.PHONY:
tidy:
go mod tidy
cd tools && go mod tidy
cd templates_tests && go mod tidy
.PHONY:
all: ./bin/gowrap generate lint test
.PHONY:
release: ./bin/goreleaser
GITHUB_TOKEN=`cat .gh_token` goreleaser release
.PHONY:
build: ./bin/goreleaser
goreleaser build --snapshot --rm-dist
.PHONY:
clean:
rm -rf ./bin