-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
80 lines (58 loc) · 2.04 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
.PHONY: all run mkdist zip linux check_git_status poetry_patch poetry_minor poetry_major commit_version_bump publish patch minor major clean distclean
END=\033[0m
GREEN=\033[34m
all: linux zip
run:
@poetry run python pucoti.py
mkdist:
@mkdir -p dist
zip: mkdist
@echo -e "$(GREEN)Updating zip...$(END)"
@git ls-files | zip --filesync -r --names-stdin dist/pucoti.zip
linux: mkdist
@echo -e "$(GREEN)Building for linux...$(END)"
poetry run pyinstaller --noconsole --add-data assets/:assets --onefile pucoti.py
# For this to work on linux, I needed to download the python 32-bit installer and run it with wine
# Then I had to install the deps (wine pip install .) and pyinstaller (wine pip install pyinstaller)
# And make windows worked!
windows: mkdist
@echo -e "$(GREEN)Building for windows...$(END)"
WINEDEBUG=-all wine pyinstaller.exe --noconsole --add-data assets\;assets --onefile pucoti.py
poetry_patch:
poetry version patch
poetry_minor:
poetry version minor
poetry_major:
poetry version major
commit_version_bump:
@echo "Bumped version to $$(poetry version -s)"
git add pyproject.toml
git commit -m "chore: bump version to $$(poetry version -s)"
git tag -a "v$$(poetry version -s)" -m "v$$(poetry version -s)"
check_git_status:
@if [ -n "$$(git status --porcelain)" ]; then \
echo "Git working directory is not clean. Please commit or stash your changes."; \
read -p "Continue anyway? [y/N] " CONTINUE; \
if [ "$$CONTINUE" != "y" ]; then \
exit 1; \
fi; \
fi
wheel:
poetry build
patch: check_git_status poetry_patch commit_version_bump wheel
minor: check_git_status poetry_minor commit_version_bump wheel
major: check_git_status poetry_major commit_version_bump wheel
publish:
poetry publish
clean:
rm -r build
rm -r **/__pycache__ __pycache__
distclean: clean
rm -r dist
deploy:
# Push files by ssh to hyperion in ./pucoti
git ls-files | rsync -avz --files-from=- . hyperion:pucoti
# Restart the service
ssh hyperion "systemctl --user restart pucoti"
server:
poetry run uvicorn pucoti.server:app --reload --port 9123