forked from stevegrunwell/asimov
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (42 loc) · 2.5 KB
/
Makefile
File metadata and controls
63 lines (42 loc) · 2.5 KB
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
.DEFAULT_GOAL := help
.PHONY: help test lint check install uninstall exclusions version release release-beta
## —————————— 🎵 Asimov 🎵 ————————————————————————————————————
help: ## Show this help
@grep -E '(^[a-zA-Z0-9_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}{printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'
version: ## Print asimov version
@./asimov --version
exclusions: ## List all paths excluded from Time Machine
@sudo mdfind "com_apple_backup_excludeItem = 'com.apple.backupd'"
## —————————— 🛠 Development ———————————————————————————————————
test: ## Run Bats tests
@bats tests/sentinels.bats tests/behavior.bats tests/plist.bats
lint: ## Run Shellcheck on all shell scripts
@shellcheck asimov scripts/install.sh scripts/uninstall.sh tests/test_helper.bash tests/bin/run-tests.sh tests/bin/tmutil tests/bin/mdfind
check: test lint ## Run tests and linting
## —————————— 📦 Installation ——————————————————————————————————
NAME ?= asimov
install: ## Install Asimov and schedule via launchd (NAME=asimov2 to install under a different name for testing)
@NAME=$(NAME) scripts/install.sh
uninstall: ## Uninstall Asimov and remove launchd schedule (NAME=asimov2 to remove a non-default install)
@NAME=$(NAME) scripts/uninstall.sh
## —————————— 🚀 Release ———————————————————————————————————————
release: check ## Tag and push a stable release — GitHub Actions will create the release
@set -e; \
VERSION=$$(./asimov --version); \
TAG="v$$VERSION"; \
echo "Tagging $$TAG..."; \
git tag -a "$$TAG" -m "Release $$TAG"; \
git push origin "$$TAG"; \
echo "Tag $$TAG pushed — GitHub Actions will create the release."
release-beta: check ## Tag and push a beta pre-release — GitHub Actions will create the pre-release
@set -e; \
VERSION=$$(./asimov --version); \
BETA_NUM=1; \
while git tag | grep -q "^v$$VERSION-beta\.$$BETA_NUM$$"; do \
BETA_NUM=$$((BETA_NUM + 1)); \
done; \
TAG="v$$VERSION-beta.$$BETA_NUM"; \
echo "Tagging $$TAG..."; \
git tag -a "$$TAG" -m "Pre-release $$TAG"; \
git push origin "$$TAG"; \
echo "Tag $$TAG pushed — GitHub Actions will create the pre-release."