-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (29 loc) · 833 Bytes
/
Makefile
File metadata and controls
37 lines (29 loc) · 833 Bytes
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/v2@v2.5.0
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