forked from tfquery/tfquery
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (26 loc) · 779 Bytes
/
Copy pathMakefile
File metadata and controls
35 lines (26 loc) · 779 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
.PHONY: default build check clean install release test tflint
CLEAN_DAYS=30
INSTALL_DIR=${HOME}/bin
OUT=/tmp/tfctl
default: build
build:
go build -o $(OUT)
check:
tools/check.sh --all
clean:
tools/clean.sh 30
install: build
mv $(OUT) $(INSTALL_DIR)
release:
@if [ -z "$(VERSION)" ]; then echo "Usage: make release VERSION=x.y.z"; exit 1; fi
@if ! echo "$(VERSION)" | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+$$'; then \
echo "Error: VERSION must be a valid semantic version (e.g. v0.2.0) with leading 'v'. Got: $(VERSION)"; \
exit 1; \
fi
git push origin --delete "$(VERSION)" || true
git tag --delete "$(VERSION)" || true
git tag "$(VERSION)" --message "Release $(VERSION)."
git push origin
git push origin "$(VERSION)"
test: build
go test ./... --count 1 -v