-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (42 loc) · 993 Bytes
/
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
46
47
48
49
50
51
52
53
.PHONY: download
dl:
@echo Download go.mod dependencies
@go mod download
# https://marcofranssen.nl/manage-go-tools-via-go-modules/
.PHONY: install-tool
tools: dl
@echo Installing tools from scripts/tools.go
@cat scripts/tools.go | grep _ | awk -F'"' '{print $$2}' | xargs -tI % go install %
.PHONY: gen
gen:
go generate ./...
.PHONY: fmt
fmt:
go fmt ./...
.PHONY: vet
vet:
go vet ./...
.PHONY: build
build: clean
mkdir -p ./dist
go build -o ./dist/seaworthy ./cmd/seaworthy
chmod +x ./dist/seaworthy
.PHONY: clean
clean:
rm -fr ./dist
.PHONY: test
test:
gotestsum --format testname ./...
.PHONY: cover
cover:
go test -race -covermode atomic -coverprofile coverage.out ./...
# PRE-COMMIT & GITHOOKS
# ---------------------
pre-commit.install:
pre-commit install --install-hooks
pre-commit.run:
pre-commit run --all-files
release: clean
@echo "--skip-publish, as we will use github actions to do this"
git-chglog -o CHANGELOG.md
goreleaser --skip-publish --rm-dist