forked from hiddify/Hiddify-Manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (46 loc) · 1.89 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
.ONESHELL:
debug: build debug-panel
debug-panel:
(cd hiddify-panel/src/ &&\
systemctl stop hiddify-panel &&\
HIDDIFY_CFG_PATH=/opt/hiddify-manager/hiddify-panel/app.cfg \
FLASK_APP=wsgi.py \
FLASK_DEBUG=1 \
python -m flask run --host=0.0.0.0 --port=9000 --reload\
build:
if [ "$(PWD)" = "/opt/hiddify-manager" -o "$(PWD)" = "/opt/hiddify-config" ]; then \
echo "You cannot build from /opt/hiddify-manager. Clone the repository outside this folder."; \
exit 2; \
else \
mkdir -p /opt/hiddify-manager && \
cp -r ./* /opt/hiddify-manager/ && \
rm -rf /opt/hiddify-manager/hiddify-panel/src/ && \
(cd hiddify-panel/src/ && pip install -e .) && \
(cd /opt/hiddify-manager/ && bash install.sh --no-gui); \
fi
# sync_panel:
# @bash -c '\
# cd hiddify-panel/src && \
# git pull'
.PHONY: release
release:
ifeq ($(TAG),)
@echo "previous tag was $$(git describe --tags $$(git rev-list --tags --max-count=1))"
@echo "release last version $$(lastversion Hiddify-Manager) "
@echo "beta last version $$(lastversion --pre Hiddify-Manager) "
@echo "WARNING: This operation will create s version tag and push to github"
@read -p "Version? (provide the next x.y.z semver) : " TAG
endif
@VERSION_STR=$$(echo $$TAG | grep -Eo '^[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}(\.dev[0-9]{1,2})?')
[ ! -z "$$VERSION_STR" ] || { echo "Incorrect tag. e.g., 1.2.3 or 1.2.3.dev1"; exit 1; }
@echo "$${TAG}" > VERSION
@make -C ./hiddify-panel/src release TAG=$${TAG}
@git tag $${TAG} > /dev/null
@gitchangelog > HISTORY.md || { git tag -d $${TAG}; echo "Please run pip install gitchangelog pystache mustache markdown"; exit 2; }
@git tag -d $${TAG} > /dev/null
@git add VERSION HISTORY.md hiddify-panel/src
@git commit -m "release: version $${TAG} 🚀"
@echo "creating git tag : v$${TAG}"
@git tag v$${TAG}
@git push -u origin HEAD --tags
@echo "Github Actions will detect the new tag and release the new version."