-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
62 lines (49 loc) · 1.22 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
SOURCE=./...
GOFMT_FILES?=$$(find . -type f -name '*.go')
VERSION?=0.1.4
default: build
tools:
go install github.com/goreleaser/[email protected]
.PHONY: tools
build: tools
goreleaser release \
--snapshot \
--skip-publish \
--rm-dist
.PHONY: build
test: vet fmtcheck
go test -v -coverprofile=coverage.out -count=1 $(SOURCE)
.PHONY: test
acc-test:
go test -v --tags=acceptance $(SOURCE)
.PHONY: acceptance-test
vet:
go vet $(SOURCE)
.PHONY: vet
fmt:
gofmt -w $(GOFMT_FILES)
.PHONY: fmt
fmtcheck:
test -z $(shell go fmt $(SOURCE))
.PHONY: fmtcheck
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
# TODO: dynamically set architecture, which is currently hard-coded to amd64
# And why is a dist/gh-dispatch_linux_amd64_v1/gh-dispatch (note the _v1) produced in GHA?
install:
mkdir -p ~/.local/share/gh/extensions/gh-dispatch
cp dist/gh-dispatch_$(shell echo $(shell uname) | tr '[:upper:]' '[:lower:]')_amd64*/gh-dispatch ~/.local/share/gh/extensions/gh-dispatch/
.PHONY: install
demo:
vhs < demo.tape
.PHONY: demo