Skip to content

Commit

Permalink
Update release branch
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
  • Loading branch information
gaborbernat committed Dec 18, 2022
1 parent 864332f commit 45e2c29
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions tasks/release.py
Expand Up @@ -17,12 +17,19 @@ def main(version_str: str) -> None:
if repo.is_dirty():
raise RuntimeError("Current repository is dirty. Please commit any changes and try again.")
upstream, release_branch = create_release_branch(repo, version)
release_commit = release_changelog(repo, version)
tag = tag_release_commit(release_commit, repo, version)
print("push release commit")
repo.git.push(upstream.name, release_branch)
print("push release tag")
repo.git.push(upstream.name, tag)
try:
release_commit = release_changelog(repo, version)
tag = tag_release_commit(release_commit, repo, version)
print("push release commit")
repo.git.push(upstream.name, f"{release_branch}:main", "-f")
print("push release tag")
repo.git.push(upstream.name, tag, "-f")
finally:
print("checkout main to new release and delete release branch")
repo.heads.main.checkout()
repo.delete_head(release_branch)
upstream.fetch()
repo.git.reset("--hard upstream/main")
print("All done! ✨ 🍰 ✨")


Expand Down

0 comments on commit 45e2c29

Please sign in to comment.