-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
45 lines (31 loc) · 874 Bytes
/
Copy pathmakefile
File metadata and controls
45 lines (31 loc) · 874 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
38
39
40
41
42
43
44
45
BINARY := azurenights
PKG := ./...
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
LDFLAGS := -s -w -X main.version=$(VERSION)
.PHONY: run build test vet fmt fmtcheck balance tidy clean docker-build docker-run snapshot ci
run:
go run ./cmd/rpg
build:
go build -trimpath -ldflags="$(LDFLAGS)" -o bin/$(BINARY) ./cmd/rpg
test:
go test $(PKG) -race -count=1
vet:
go vet $(PKG)
fmt:
gofmt -w .
fmtcheck:
@test -z "$$(gofmt -l .)" || (echo "unformatted files:"; gofmt -l .; exit 1)
balance:
go run ./cmd/balance
tidy:
go mod tidy
clean:
rm -rf bin dist
docker-build:
docker build -t $(BINARY) .
docker-run:
docker run --rm -it $(BINARY)
# Dry-run the release build locally (requires goreleaser).
snapshot:
goreleaser release --snapshot --clean
ci: fmtcheck vet test build