diff options
author | jade <lix@jade.fyi> | 2024-08-08 23:12:11 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@localhost> | 2024-08-08 23:12:11 +0000 |
commit | 3b902683e93ad21be3537ef77f3e5200fbbed900 (patch) | |
tree | cd2c01633d9530758da972e9ff97d22ddcc8b111 /releng/create_release.xsh | |
parent | 9682ab4f3859ca60b0b4525452b27297e31cb751 (diff) | |
parent | 7246c2d104f12877de7d5b20033346eff88048e6 (diff) |
Merge changes I0373ac01,I7b543967,I537103eb into main
* changes:
releng: fix the git push
releng: clarify/update docs, add instructions after tag
Fix is_maintenance_branch heuristic
Diffstat (limited to 'releng/create_release.xsh')
-rw-r--r-- | releng/create_release.xsh | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/releng/create_release.xsh b/releng/create_release.xsh index 62114350b..d8d6e8a83 100644 --- a/releng/create_release.xsh +++ b/releng/create_release.xsh @@ -2,6 +2,7 @@ import json import subprocess import itertools import textwrap +import logging from pathlib import Path import tempfile import hashlib @@ -15,6 +16,8 @@ from .version import VERSION, RELEASE_NAME, MAJOR, OFFICIAL_RELEASE from .gitutils import verify_are_on_tag, git_preconditions from . import release_notes +log = logging.getLogger(__name__) + $RAISE_SUBPROC_ERROR = True $XONSH_SHOW_TRACEBACK = True @@ -55,6 +58,9 @@ def official_release_commit_tag(force_tag=False): git commit -m @(message) git tag @(['-f'] if force_tag else []) -a -m @(message) @(VERSION) + with open('releng/prev-git-branch.txt', 'w') as fh: + fh.write(prev_branch) + return prev_branch @@ -235,8 +241,24 @@ def upload_artifacts(env: RelengEnvironment, noconfirm=False, no_check_git=False print('[+] Upload manual') upload_manual(env) - print('[+] git push tag') - git push @(['-f'] if force_push_tag else []) @(env.git_repo) f'{VERSION}:refs/tags/{VERSION}' + prev_branch = None + try: + with open('releng/prev-git-branch.txt', 'r') as fh: + prev_branch = fh.read().strip() + except FileNotFoundError: + log.warn('Cannot find previous git branch file, skipping pushing git objects') + + if prev_branch: + print('[+] git push to the repo') + # We have to push the ref to gerrit for review at least such that the + # commit is known, before we can push it as a tag. + if env.git_repo_is_gerrit: + git push @(env.git_repo) f'{prev_branch}:refs/for/{prev_branch}' + else: + git push @(env.git_repo) f'{prev_branch}:{prev_branch}' + + print('[+] git push tag') + git push @(['-f'] if force_push_tag else []) @(env.git_repo) f'{VERSION}:refs/tags/{VERSION}' def do_tag_merge(force_tag=False, no_check_git=False): |