-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
71 lines (57 loc) · 1.52 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
62
63
64
65
66
67
68
69
70
71
BIN_DIR=./bin/
# allow passing -ldflags, etc for release builds
BUILD_ARGS ?=
.PHONY: all
all: build test
.PHONY: clean
clean:
go clean -cache -testcache -modcache
go mod tidy
.PHONY: build
build: generate
go build $(BUILD_ARGS) -o $(BIN_DIR) ./...
.PHONY: test
test:
@echo "Running Go tests..."
go test -race ./...
.PHONY: fmt
fmt:
@echo "Running Go format..."
gofmt -s -l -w .
.PHONY: lint
lint:
@echo "Linting Go code..."
golangci-lint run ./... --disable revive
.PHONY: vet
vet:
@echo "Vetting Go code..."
go vet ./...
.PHONY: generate
generate:
@echo "Generating Go code..."
go generate ./...
.PHONY: increment-version-patch
increment-version-patch:
@echo "Incrementing version patch..."
@./scripts/increment_version.sh -p internal/version/VERSION
@cat internal/version/VERSION
.PHONY: increment-version-minor
increment-version-minor:
@echo "Incrementing version minor..."
@./scripts/increment_version.sh -m internal/version/VERSION
@cat internal/version/VERSION
.PHONY: increment-version-major
increment-version-major:
@echo "Incrementing version major..."
@./scripts/increment_version.sh -M internal/version/VERSION
@cat internal/version/VERSION
.PHONY: set-version-prerelease
set-version-prerelease:
@echo "Setting prerelease version..."
@./scripts/increment_version.sh -r internal/version/VERSION
@cat internal/version/VERSION
.PHONY: set-version-release
set-version-release:
@echo "Setting release version..."
@./scripts/increment_version.sh -R internal/version/VERSION
@cat internal/version/VERSION