diff options
| author | Roy Sommer <roy@sommer.co.il> | 2020-01-23 21:19:53 +0200 |
|---|---|---|
| committer | Roy Sommer <roy@sommer.co.il> | 2020-01-23 21:19:53 +0200 |
| commit | 218a33d8b2929aeb58d4d1e260f022c09fc5763c (patch) | |
| tree | 57d8890a84f0370248da4a78ccce882e3ec160d3 | |
| parent | bumped patch version (diff) | |
| download | taskipy2-218a33d8b2929aeb58d4d1e260f022c09fc5763c.zip | |
now automatically adding release tag whenever released
| -rw-r--r-- | hooks/tag_release.py | 19 | ||||
| -rw-r--r-- | pyproject.toml | 8 |
2 files changed, 23 insertions, 4 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() + diff --git a/pyproject.toml b/pyproject.toml index d2e0298..7d2f679 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,13 +39,13 @@ lint_mypy = "mypy tests taskipy" pre_publish = "./task test" publish = "poetry publish --build" +commit_release = "python ./hooks/tag_release.py" + pre_publish_patch = "./task test" -bump_patch_version = "poetry version patch && git add . && git commit -m 'bumped patch version' && git push" -publish_patch = "./task bump_patch_version && poetry publish --build" +publish_patch = "poetry version patch && commit_release && poetry publish --build" pre_publish_minor = "./task test" -bump_minor_version = "poetry version minor && git add . && git commit -m 'bumped minor version' && git push" -publish_minor = "./task bump_minor_version && poetry publish --build" +publish_minor = "poetry version minor && commit_release && poetry publish --build" [build-system] requires = ["poetry>=0.12"] |