Skip to content

Commit fc1771a

Browse files
committed
use gh tool for releasing from Makefile
1 parent 01dcc17 commit fc1771a

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

Makefile

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1-
version := $(shell python -c "exec(open('pykeepass/version.py').read());print(__version__)")
1+
.ONESHELL:
2+
.SILENT:
3+
version := $(shell python -c "import tomllib;print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
24

35
.PHONY: dist
46
dist:
5-
python setup.py sdist bdist_wheel
7+
python -m build
68

7-
.PHONY: pypi
8-
pypi: dist
9-
twine upload dist/pykeepass-$(version).tar.gz
9+
.PHONY: release
10+
release: dist
11+
# check that changelog is updated
12+
if ! grep ${version} CHANGELOG.rst
13+
then
14+
echo "Changelog doesn't seem to be updated! Quitting..."
15+
exit 1
16+
fi
17+
twine upload dist/pykeepass-$(version)*
18+
gh release create pykeepass-$(version) dist/pykeepass-$(version)*
1019

1120
.PHONY: docs
1221
docs:

0 commit comments

Comments
 (0)