-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (29 loc) · 830 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
.DEFAULT_GOAL := build
.PHONY: pretty clean build test package tools
tools:
@echo "Installing tools..."
command -v goreleaser || go install github.com/goreleaser/goreleaser@latest
command -v goimports || go install golang.org/x/tools/cmd/goimports@latest
deps:
@echo "Downloading dependencies..."
go mod download
build:
@echo "Building for your arch..."
rm -rf ./dist/*
goreleaser build --snapshot
test:
@echo "Running tests..."
go test -v ./pkg/...
clean:
@echo "Cleaning up..."
-rm -rf bin dist
pretty: tools
@echo "Making it all pretty..."
gofmt -w -s cmd internal pkg
goimports -w cmd internal pkg
package: clean pretty build
@echo "Packaging for your arch..."
goreleaser release --clean
package-snapshot: clean pretty build
@echo "Packaging for your arch..."
goreleaser release --clean --snapshot