Skip to content

Commit d08c275

Browse files
committed
tag target in Makefile
1 parent d9661f3 commit d08c275

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Makefile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ dist:
99

1010
.PHONY: release
1111
release: lock dist
12-
# check that changelog is updated
13-
if ! grep ${version} CHANGELOG.rst
12+
# check that changelog is updated. only look at first 3 parts of semver
13+
version=$(version)
14+
stripped=$$(echo $${version} | cut -d . -f -3)
15+
if ! grep $${stripped} CHANGELOG.rst
1416
then
1517
echo "Changelog doesn't seem to be updated! Quitting..."
1618
exit 1
@@ -20,14 +22,22 @@ release: lock dist
2022

2123
.PHONY: lock
2224
lock:
23-
# make a requirements.txt lockfile
25+
# run tests then make a requirements.txt lockfile
2426
rm -rf .venv_lock
2527
virtualenv .venv_lock
2628
. .venv_lock/bin/activate
2729
pip install .[test]
2830
python tests/tests.py
2931
pip freeze > requirements.txt
3032

33+
.PHONY: tag
34+
tag:
35+
# tag git commit
36+
git add requirements.txt
37+
git add CHANGELOG.rst
38+
git commit -m "bump version"
39+
git tag -a v$(version) -m "version $(version)"
40+
3141

3242
.PHONY: docs
3343
docs:

0 commit comments

Comments
 (0)