-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
64 lines (52 loc) · 1.14 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
VERSION = 0.0.8
SOURCE = ./...
.DEFAULT_GOAL := build
help:
# build: build terraputs (default make target)
# tools: install build dependencies
# vet: run 'go vet' against source code
# test: run automated tests
# check-tag: check if a $(VERSION) git tag already exists
# tag: create a $(VERSION) git tag
# release: build and publish a terraputs GitHub release
# clean: remove compiled artifacts
tools:
go install github.com/goreleaser/goreleaser@latest
.PHONY: tools
build: tools
goreleaser release \
--snapshot \
--skip-publish \
--rm-dist
.PHONY: build
vet:
go vet $(SOURCE)
.PHONY: vet
test-fmt:
test -z $(shell go fmt $(SOURCE))
.PHONY: test-fmt
test: vet test-fmt
go test -cover $(SOURCE) -count=1
.PHONY: test
check-tag:
./scripts/ensure-unique-version.sh "$(VERSION)"
.PHONY: check-tag
tag: check-tag
@echo "creating git tag $(VERSION)"
@git tag $(VERSION)
@git push origin $(VERSION)
.PHONY: tag
release: tools
goreleaser release \
--rm-dist
.PHONY: release
demo:
svg-term \
--cast 423523 \
--out demo.svg \
--window \
--no-cursor
.PHONY: demo
clean:
rm -rf dist
.PHONY: clean