aboutsummaryrefslogtreecommitdiffstats
path: root/hooks
diff options
context:
space:
mode:
authorRoy Sommer <roy@sommer.co.il>2020-01-23 21:19:53 +0200
committerRoy Sommer <roy@sommer.co.il>2020-01-23 21:19:53 +0200
commit218a33d8b2929aeb58d4d1e260f022c09fc5763c (patch)
tree57d8890a84f0370248da4a78ccce882e3ec160d3 /hooks
parentbumped patch version (diff)
downloadtaskipy2-218a33d8b2929aeb58d4d1e260f022c09fc5763c.zip
now automatically adding release tag whenever released
Diffstat (limited to 'hooks')
-rw-r--r--hooks/tag_release.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/hooks/tag_release.py b/hooks/tag_release.py
new file mode 100644
index 0000000..34caea6
--- /dev/null
+++ b/hooks/tag_release.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python3
+import toml
+import subprocess
+import os
+from os import path
+
+def create_release_commit():
+ pyproject = toml.load(path.join(os.curdir, 'pyproject.toml'))
+ version = pyproject['tool']['poetry']['version']
+
+ p = subprocess.Popen(f'git add . && git commit -m "Release version {version}" && git tag -a "{version}" -m "Release version {version}" && git push && git push --tags',
+ shell=True,
+ cwd=os.curdir)
+
+ p.wait()
+
+if __name__ == '__main__':
+ create_release_commit()
+