-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
43 lines (33 loc) · 772 Bytes
/
makefile
File metadata and controls
43 lines (33 loc) · 772 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
.PHONY: build run test lint clean
BUILD_VERSION ?= $(shell git describe --tags --always --dirty="-dirty")
COMMIT ?= $(shell git rev-parse --short HEAD)
DATE ?= $(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
build:
mkdir -p bin
CGO_ENABLED=0 go build \
-trimpath \
-ldflags="-s -w \
-X main.version=$(BUILD_VERSION) \
-X main.commit=$(COMMIT) \
-X main.buildDate=$(DATE)" \
-o bin/terminaltask ./cmd/terminaltask
run: build
./setup.sh
./bin/terminaltask
release:
@if [[ -z "$(VERSION)" ]]; then \
echo "Usage: make release VERSION=v0.1.1"; \
exit 1; \
fi
git tag $(VERSION)
git push origin $(VERSION)
test:
go test ./...
cover:
go test ./... -cover
coverage:
go test ./... -coverprofile=coverage.out
lint:
golangci-lint run
clean:
rm -rf bin/