blob: 0c4b3a77ed44a927207dc7697cce97456b6db0c7 (
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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#!/usr/bin/env python3
import tomli
import secrets
import subprocess
import webbrowser
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"]
branch = f"release-{version}-{secrets.token_hex(12)}"
p = subprocess.Popen(
" && ".join(
[
f"git checkout -b {branch}",
"git add .",
f'git commit -m "Release version {version}"',
f'git tag -a "{version}" -m "Release version {version}"',
f"git push --set-upstream origin {branch}",
f"git push --tags",
]
),
shell=True,
cwd=cwd,
)
p.wait()
webbrowser.open(
f"https://github.com/taskipy/taskipy/compare/{branch}?quick_pull=1&title=Release%20Version%20{version}&body=%3E%20Please%20describe%20your%20release%20here"
)
if __name__ == "__main__":
create_release_commit()
|