blob: e7d28299b5e4a0ce06e8a98db880990d426f0795 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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 --allow-empty -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()
|