-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (41 loc) · 937 Bytes
/
Makefile
File metadata and controls
56 lines (41 loc) · 937 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
45
46
47
48
49
50
51
52
53
54
55
56
export GO111MODULE:=on
export CGO_ENABLED:=0
BIN = bin
DIST = dist
GO = go
GORELEASER = $(BIN)/goreleaser
.PHONY: all
all: fmt tidy build test
.PHONY: build
build:
@go build -o cola ./cmd/cola
.PHONY: test
test:
@go test ./... -cover
.PHONY: fmt
fmt:
@test -z $$(go fmt ./...)
.PHONY: lint
lint:
@golangci-lint run ./...
.PHONY: tidy
tidy:
@go mod tidy
clean:
@rm -rf dist
$(BIN):
@mkdir -p $@
$(BIN)/%: | $(BIN)
env GOBIN=$(abspath $(BIN)) $(GO) install $(PACKAGE)
$(BIN)/goreleaser: PACKAGE=github.com/goreleaser/goreleaser/v2@latest
.PHONY: release
release: $(GORELEASER)
$(GORELEASER) release --clean
.PHONY: snapshot
snapshot: $(GORELEASER)
$(GORELEASER) release --snapshot --clean
.PHONY: docs
docs:
@mkdir -p dist/docs
@docker build -t cola-docs-builder:local ./docs/
@docker run -v $(PWD):/repo cola-docs-builder:local npx antora generate antora-playbook.yaml --to-dir /repo/dist/docs