From 3b4d2b458ce66c883621191a580f340eabb60c60 Mon Sep 17 00:00:00 2001 From: Curtis Wan Date: Thu, 4 Jan 2024 11:32:23 +0800 Subject: [PATCH 1/2] ci: Bump version to 1.0.0-rc4 --- automq_release.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/automq_release.py b/automq_release.py index a634bcf922..15cf10a3cb 100644 --- a/automq_release.py +++ b/automq_release.py @@ -23,9 +23,9 @@ from pathlib import Path import argparse - main_branch = "develop" + def fail(msg): print(msg) sys.exit(1) @@ -150,8 +150,8 @@ def do_release(tag_version): print("updating docker compose") regexReplace("docker/docker-compose.yaml", "image: automqinc/kafka:.*$", "image: automqinc/kafka:%s" % tag_version) - cmd("Committing changes", ["git", "commit", "-a", "-m", "ci: Bump version to %s" % tag_version]) - cmd("Pushing changes", ["git", "push", "origin", new_branch]) + cmd("Committing changes", ["git", "commit", "-a", "-m", "ci: Bump version to %s" % tag_version], allow_failure=True) + cmd("Pushing changes", ["git", "push", "origin", new_branch], allow_failure=True) cmd("Tagging %s" % tag_version, ["git", "tag", "-a", tag_version, "-m", "release %s" % tag_version, "-s"]) cmd("Pushing tag %s" % tag_version, ["git", "push", "origin", tag_version]) @@ -161,14 +161,15 @@ def clean_local_tags(): tags = cmd_output('git tag -l').split() cmd("Cleaning local tags", ['git', 'tag', '-d'] + tags) + def check_before_started(tag_version): check_tools(["git"]) - cmd("Verifying that you have no unstaged git changes", 'git diff --exit-code --quiet') - cmd("Verifying that you have no staged git changes", 'git diff --cached --exit-code --quiet') +# cmd("Verifying that you have no unstaged git changes", 'git diff --exit-code --quiet') +# cmd("Verifying that you have no staged git changes", 'git diff --cached --exit-code --quiet') starting_branch = cmd_output('git rev-parse --abbrev-ref HEAD').strip() if starting_branch != main_branch: fail("You must run this script from the %s branch. current: %s" % (main_branch, starting_branch)) - cmd("Pull latest code", 'git pull --rebase origin %s' % main_branch) +# cmd("Pull latest code", 'git pull --rebase origin %s' % main_branch) # Validate that the release doesn't already exist clean_local_tags() From 99fd7cf3f6371b524b2d65de737079ebba73d037 Mon Sep 17 00:00:00 2001 From: Curtis Wan Date: Thu, 4 Jan 2024 11:33:26 +0800 Subject: [PATCH 2/2] fix(ci): allow empty commit Signed-off-by: Curtis Wan --- automq_release.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/automq_release.py b/automq_release.py index 15cf10a3cb..63d9c59af6 100644 --- a/automq_release.py +++ b/automq_release.py @@ -164,12 +164,12 @@ def clean_local_tags(): def check_before_started(tag_version): check_tools(["git"]) -# cmd("Verifying that you have no unstaged git changes", 'git diff --exit-code --quiet') -# cmd("Verifying that you have no staged git changes", 'git diff --cached --exit-code --quiet') + cmd("Verifying that you have no unstaged git changes", 'git diff --exit-code --quiet') + cmd("Verifying that you have no staged git changes", 'git diff --cached --exit-code --quiet') starting_branch = cmd_output('git rev-parse --abbrev-ref HEAD').strip() if starting_branch != main_branch: fail("You must run this script from the %s branch. current: %s" % (main_branch, starting_branch)) -# cmd("Pull latest code", 'git pull --rebase origin %s' % main_branch) + cmd("Pull latest code", 'git pull --rebase origin %s' % main_branch) # Validate that the release doesn't already exist clean_local_tags()