diff options
| author | Roy Sommer <royso@wix.com> | 2023-05-25 23:54:07 +0300 |
|---|---|---|
| committer | Roy Sommer <royso@wix.com> | 2023-05-25 23:54:07 +0300 |
| commit | 3f8b8aedfc94bf5079c74c52e235041dce2067e9 (patch) | |
| tree | 3381e028123d6169803bb0a8b4f5e93f38a9ea6d /.hooks/make_release_commit.py | |
| parent | Update lint workflow to not exclude test deps (diff) | |
| download | poetry-plugin-taskipy2-3f8b8aedfc94bf5079c74c52e235041dce2067e9.zip | |
getting ready to release
Diffstat (limited to '.hooks/make_release_commit.py')
| -rw-r--r-- | .hooks/make_release_commit.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/.hooks/make_release_commit.py b/.hooks/make_release_commit.py new file mode 100644 index 0000000..77b1971 --- /dev/null +++ b/.hooks/make_release_commit.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 +import tomli +import subprocess +from pathlib import Path + + +def create_release_commit(): + cwd = Path.cwd() + with open(cwd / "pyproject.toml", "rb") as file: + pyproject = tomli.load(file) + 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=cwd, + ) + + p.wait() + + +if __name__ == "__main__": + create_release_commit() |