| 51 | |
| 52 | |
| 53 | def create_git_branch(release_version, dry_run): |
| 54 | branch_name = 'version_' + release_version |
| 55 | |
| 56 | # Create a new git branch from upstream/main |
| 57 | print(f'Checking out new branch {branch_name} from {GIT_REMOTE}/main') |
| 58 | subprocess.check_call(['git', 'checkout', '-b', branch_name, f'{GIT_REMOTE}/main'], cwd=root_dir) |
| 59 | |
| 60 | # Create auto-generated changes to the new git branch |
| 61 | subprocess.check_call(['git', 'add', '-u', '.'], cwd=root_dir) |
| 62 | subprocess.check_call(['git', 'commit', '-m', f'Mark {release_version} as released'], cwd=root_dir) |
| 63 | print('New release created in branch: `%s`' % branch_name) |
| 64 | |
| 65 | if not dry_run: |
| 66 | # Push new branch to upstream |
| 67 | subprocess.check_call(['git', 'push', GIT_REMOTE, branch_name], cwd=root_dir) |
| 68 | |
| 69 | |
| 70 | def create_draft_release(version, base_commit): |