-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (34 loc) · 1.15 KB
/
Copy pathMakefile
File metadata and controls
38 lines (34 loc) · 1.15 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
.PHONY: dev update push clean
clean:
@echo ">> Stopping running processes..."
@bash -c 'SELF=$$$$; pgrep -f "RootBrowser" 2>/dev/null | while read pid; do [ "$$pid" != "$$SELF" ] && kill "$$pid" 2>/dev/null; done; exit 0'
@echo ">> Removing build artifacts..."
@rm -rf src-tauri/target
@rm -rf build
@echo ">> Done"
dev:
@bash dev.sh
update:
@bash update.sh
push:
@CURRENT=$$(cat VERSION); \
if [ -n "$(VERSION)" ]; then \
NEXT="$(VERSION)"; \
else \
MAJOR=$$(echo $$CURRENT | cut -d. -f1); \
MINOR=$$(echo $$CURRENT | cut -d. -f2); \
PATCH=$$(echo $$CURRENT | cut -d. -f3); \
NEXT="$$MAJOR.$$MINOR.$$((PATCH + 1))"; \
fi; \
echo ">> Bumping $$CURRENT → $$NEXT"; \
echo "$$NEXT" > VERSION; \
sed -i 's/"version": "[^"]*"/"version": "'"$$NEXT"'"/' package.json; \
sed -i 's/"version": "[^"]*"/"version": "'"$$NEXT"'"/' src-tauri/tauri.conf.json; \
sed -i '0,/^version = "[^"]*"/{s/^version = "[^"]*"/version = "'"$$NEXT"'"/}' src-tauri/Cargo.toml; \
MSG="$(MSG)"; \
COMMIT_MSG=$${MSG:-"release $$NEXT"}; \
git add -A; \
git commit -m "$$COMMIT_MSG"; \
git tag v$$NEXT; \
git push && git push origin v$$NEXT; \
echo ">> Released v$$NEXT"