diff --git a/.circleci/scripts/bump-part.py b/.circleci/scripts/bump-part.py index 4e7cadd7f..abc9b30db 100755 --- a/.circleci/scripts/bump-part.py +++ b/.circleci/scripts/bump-part.py @@ -1,5 +1,4 @@ import os -import pathlib import subprocess import requests @@ -27,6 +26,12 @@ exit() +def get_last_tag(): + return subprocess.run( + "git describe --tags".split(" "), check=True, stdout=subprocess.PIPE + ).stdout.decode("UTF-8") + + part = "" bump_release_type = None if CURRENT_BRANCH == "dev": @@ -83,9 +88,9 @@ ) if CURRENT_BRANCH == "master" and COMMIT_TYPE == "RELEASE": - r = subprocess.run(f"git --git-dir={PROJECT_GIT_DIR} describe --abbrev=0 --tags".split(" "), check=True, stdout=subprocess.PIPE) + r = subprocess.run(f"git --git-dir={PROJECT_GIT_DIR} describe --abbrev=0 --tags", check=True) tag = r.stdout.decode("UTF-8").strip(" ").strip("\n") - make_chlog(pathlib.Path(f"{PROJECT_ROOT}/CHANGES.rst"), new_version=tag) + make_chlog(Path(f"{PROJECT_ROOT}/CHANGES.rst"), new_version=tag) print("Push Bump commit..") subprocess.run( diff --git a/.circleci/scripts/chlogger.py b/.circleci/scripts/chlogger.py index 8c528606a..44a0cfd1a 100644 --- a/.circleci/scripts/chlogger.py +++ b/.circleci/scripts/chlogger.py @@ -130,8 +130,8 @@ def make_chlog(chlog_path, new_version): "0.4.0", format_commits(feats), format_commits(fixes), format_commits(hotfixes), chlog_path ) - subprocess.run(f"git --git-dir={PROJECT_GIT_DIR} add {chlog_path}".split(" "), check=True) + subprocess.run(f"git --git-dir={PROJECT_GIT_DIR} git add CHANGELOG.rst".split(" "), check=True) subprocess.run( - f"git --git-dir={PROJECT_GIT_DIR} commit {chlog_path} -m".split(" ") + ['"Update Changelog."'], + f"git --git-dir={PROJECT_GIT_DIR} git commit CHANGELOG.rst -m \"Update Changelog.\"".split(" "), check=True )