-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile
More file actions
44 lines (34 loc) · 975 Bytes
/
makefile
File metadata and controls
44 lines (34 loc) · 975 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
GIT_COMMIT := $(shell git describe --always --dirty)
GOPATH=$(shell go env GOPATH)/bin
RELEASE_TAG=rolling
all: build lint count
build: format
@echo '- build'
@env go build -ldflags="-X github.com/ntorresalberto/dogi/cmd.Version=$(GIT_COMMIT)"
release:
@echo '- release'
@git tag -d ${RELEASE_TAG}
@git push origin :refs/tags/${RELEASE_TAG}
@git tag -f ${RELEASE_TAG}
@git push origin rolling
@env CGO_ENABLED=0 go build -ldflags="-X github.com/ntorresalberto/dogi/cmd.Version=$(GIT_COMMIT)"
install: format
@echo '- install'
@env go install -a -ldflags="-X github.com/ntorresalberto/dogi/cmd.Version=$(GIT_COMMIT)" .
version:
@echo '- version: ${GIT_COMMIT}'
vet:
@echo '- go vet'
@go vet ./...
tidy:
@echo '- go mod tidy'
@go mod tidy
format: version tidy vet
@echo '- format'
@go fmt ./...
lint:
@echo '- lint'
@${GOPATH}/golangci-lint run ./...
count:
@echo '- count'
@${GOPATH}/gocloc main.go assets/createUser.sh.in assets/assets.go cmd/