Skip to content

Commit 35bf1ba

Browse files
committed
Make version in makefile dynamic
1 parent e1f015b commit 35bf1ba

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Diff for: Makefile

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
VERSION := $(shell grep -m 1 version pyproject.toml | tr -s ' ' | tr -d '"' | tr -d "'" | cut -d' ' -f3)
2+
13
define SCRIPT
24
if ! type pip &> /dev/null; then
35
if ! type opkg &> /dev/null; then
@@ -7,21 +9,21 @@ if ! type pip &> /dev/null; then
79
opkg update
810
opkg install python3-pip
911
fi
10-
pip install --force-reinstall /tmp/liboxide-0.1.0-py3-none-any.whl
12+
pip install --force-reinstall /tmp/liboxide-${VERSION}-py3-none-any.whl
1113
endef
1214
export SCRIPT
1315

14-
dist/liboxide-0.1.0.tar.gz: $(shell find liboxide -type f)
16+
dist/liboxide-${VERSION}.tar.gz: $(shell find liboxide -type f)
1517
python -m build --sdist
1618

17-
dist/liboxide-0.1.0-py3-none-any.whl: $(shell find liboxide -type f)
19+
dist/liboxide-${VERSION}-py3-none-any.whl: $(shell find liboxide -type f)
1820
python -m build --wheel
1921

2022
clean:
2123
git clean --force -dX
2224

23-
deploy: dist/liboxide-0.1.0-py3-none-any.whl
24-
rsync dist/liboxide-0.1.0-py3-none-any.whl [email protected]:/tmp
25+
deploy: dist/liboxide-${VERSION}-py3-none-any.whl
26+
rsync dist/liboxide-${VERSION}-py3-none-any.whl [email protected]:/tmp
2527

2628
install: deploy
2729
echo -e "$$SCRIPT" | ssh [email protected] bash -le

0 commit comments

Comments
 (0)