-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (25 loc) · 740 Bytes
/
Copy pathMakefile
File metadata and controls
33 lines (25 loc) · 740 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
APP_NAME := cryptospect-cli
VERSION := $(shell git describe --tags --dirty 2>/dev/null)
ifeq ($(VERSION),)
LDFLAGS := -s -w
else
LDFLAGS := -s -w \
-X github.com/afshinator/cryptospect-cli/internal/version.Value=$(VERSION) \
-X github.com/afshinator/cryptospect-cli/internal/version.tagged=true
endif
.PHONY: build lint fmt vet test clean release
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o bin/$(APP_NAME) ./cmd/cryptospect-cli
fmt:
goimports -w cmd/ internal/
gofumpt -w cmd/ internal/
lint:
golangci-lint run ./...
vet:
go vet ./...
test:
GOMODCACHE=$(PWD)/.gomodcache GOCACHE=$(PWD)/.cache/go go test -race -cover ./...
clean:
rm -rf bin/ dist/
release:
goreleaser release --clean