Skip to content

Commit

Permalink
ci: Bump version to 1.0.0-rc4
Browse files Browse the repository at this point in the history
  • Loading branch information
mooc9988 committed Jan 4, 2024
1 parent cb2adb4 commit 3b4d2b4
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions automq_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
from pathlib import Path
import argparse


main_branch = "develop"


def fail(msg):
print(msg)
sys.exit(1)
Expand Down Expand Up @@ -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])
Expand All @@ -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()
Expand Down

0 comments on commit 3b4d2b4

Please sign in to comment.