aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Sommer <illBeRoy@users.noreply.github.com>2023-11-23 18:02:07 +0200
committerGitHub <noreply@github.com>2023-11-23 18:02:07 +0200
commit923fb72dc1e4e83ee1b504d49517323d9d821036 (patch)
tree601e7ede9f8b8d2bbf87d6cd3585f7abf286a668
parentUpdate release.yml (diff)
downloadtaskipy2-923fb72dc1e4e83ee1b504d49517323d9d821036.zip
Release Version 1.12.2 (#73)
* change release script * small fix to release script * Release version 1.12.2
-rw-r--r--.hooks/make_release_commit.py28
-rw-r--r--pyproject.toml2
2 files changed, 22 insertions, 8 deletions
diff --git a/.hooks/make_release_commit.py b/.hooks/make_release_commit.py
index 3097ebb..6f329d4 100644
--- a/.hooks/make_release_commit.py
+++ b/.hooks/make_release_commit.py
@@ -1,20 +1,34 @@
#!/usr/bin/env python3
import tomli
+import secrets
import subprocess
from pathlib import Path
+
def create_release_commit():
cwd = Path.cwd()
- with open(cwd / 'pyproject.toml', 'rb') as file:
+ with open(cwd / "pyproject.toml", "rb") as file:
pyproject = tomli.load(file)
- version = pyproject['tool']['poetry']['version']
+ version = pyproject["tool"]["poetry"]["version"]
+ branch = f"release-{version}-{secrets.token_hex(12)}"
- 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 = 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()
-if __name__ == '__main__':
- create_release_commit()
+if __name__ == "__main__":
+ create_release_commit()
diff --git a/pyproject.toml b/pyproject.toml
index 28ceb10..2839ae8 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,7 +1,7 @@
[tool.poetry]
name = "taskipy"
description = "tasks runner for python projects"
-version = "1.12.1"
+version = "1.12.2"
authors = ["Roy Sommer <roy@sommer.co.il>"]
readme = "README.md"
repository = "https://github.com/taskipy/taskipy"