File tree Expand file tree Collapse file tree 2 files changed +22
-8
lines changed
Expand file tree Collapse file tree 2 files changed +22
-8
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
22import tomli
3+ import secrets
34import subprocess
45from pathlib import Path
56
7+
68def create_release_commit ():
79 cwd = Path .cwd ()
8- with open (cwd / ' pyproject.toml' , 'rb' ) as file :
10+ with open (cwd / " pyproject.toml" , "rb" ) as file :
911 pyproject = tomli .load (file )
10- version = pyproject ['tool' ]['poetry' ]['version' ]
12+ version = pyproject ["tool" ]["poetry" ]["version" ]
13+ branch = f"release-{ version } -{ secrets .token_hex (12 )} "
1114
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' ,
13- shell = True ,
14- cwd = cwd )
15+ p = subprocess .Popen (
16+ " && " .join (
17+ [
18+ f"git checkout -b { branch } " ,
19+ "git add ." ,
20+ f'git commit -m "Release version { version } "' ,
21+ f'git tag -a "{ version } " -m "Release version { version } "' ,
22+ f"git push --set-upstream origin { branch } " ,
23+ f"git push --tags" ,
24+ ]
25+ ),
26+ shell = True ,
27+ cwd = cwd ,
28+ )
1529
1630 p .wait ()
1731
18- if __name__ == '__main__' :
19- create_release_commit ()
2032
33+ if __name__ == "__main__" :
34+ create_release_commit ()
Original file line number Diff line number Diff line change 11[tool .poetry ]
22name = " taskipy"
33description = " tasks runner for python projects"
4- version = " 1.12.1 "
4+ version = " 1.12.2 "
55authors = [" Roy Sommer <roy@sommer.co.il>" ]
66readme = " README.md"
77repository = " https://github.com/taskipy/taskipy"
You can’t perform that action at this time.
0 commit comments