-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
45 lines (37 loc) · 1.05 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
#####################
# smash make
# make smash
#####################
BINARY_NAME=smash
VERSION=$(shell git describe --tags --always --dirty)
GCOMMIT=$(shell git rev-parse --short HEAD)
TODAY=$(shell date --iso-8601)
.PHONY: all
all: lint test build
.PHONY: ready
ready: lint test
.PHONY: lint
lint:
golangci-lint run -c .golangci.yml ./...
.PHONY: test
test:
go test -v ./...
.PHONY: build
build:
go build -ldflags " -X github.com/thushan/smash/internal/smash.Date=$(TODAY) \
-X github.com/thushan/smash/internal/smash.User=make \
-X github.com/thushan/smash/internal/smash.Version=$(VERSION) \
-X github.com/thushan/smash/internal/smash.Commit=$(GCOMMIT) \
-s -w" \
-trimpath \
-o dist/$(BINARY_NAME) .
.PHONY: release
release:
MSYS_NO_PATHCONV=1 docker run -ti -v "$(PWD):/app" -w "/app" goreleaser/goreleaser:latest release --snapshot --clean
.PHONY: clean
clean:
go clean
rm -rf dist/
.PHONY: clean-reports
clean-reports:
rm -rf report-*.json