From 3c8d59c666bd4cda9ca54989b2f1b48bba17bc57 Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Thu, 13 Oct 2022 17:44:41 +0000 Subject: [PATCH] fix: create_release.sh release_continue --- create_release.sh | 44 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/create_release.sh b/create_release.sh index 3adbf36..799056f 100755 --- a/create_release.sh +++ b/create_release.sh @@ -1,7 +1,7 @@ #!/bin/bash # rust create_release -# v0.0.15 +# v0.1.0 PACKAGE_NAME='oxker' STAR_LINE='****************************************' @@ -193,34 +193,66 @@ cargo_build () { ask_continue } +# $1 text to colourise +release_continue () { + echo -e "\n${PURPLE}$1${RESET}" + ask_continue + +} # Full flow to create a new release release_flow() { check_git get_git_remote_url cargo_test cargo_build + cd "${CWD}" || error_close "Can't find ${CWD}" check_tag NEW_TAG_WITH_V="v${MAJOR}.${MINOR}.${PATCH}" printf "\nnew tag chosen: %s\n\n" "${NEW_TAG_WITH_V}" + RELEASE_BRANCH=release-$NEW_TAG_WITH_V echo -e ask_changelog_update + + release_continue "checkout ${RELEASE_BRANCH}" git checkout -b "$RELEASE_BRANCH" - update_version_number_in_files - cargo fmt - git add . - git commit -m "chore: release $NEW_TAG_WITH_V" + release_continue "update_version_number_in_files" + update_version_number_in_files + + echo -e "\ncargo fmt" + cargo fmt + + release_continue "git add ." + git add . + + release_continue "git commit -mg \"chore: release \"${NEW_TAG_WITH_V}\"" + git commit -m "chore: release ${NEW_TAG_WITH_V}" + + release_continue "git checkout main" git checkout main + + release_continue "git merge --no-ff \"${RELEASE_BRANCH}\" -m \"chore: merge ${RELEASE_BRANCH} into main\"" git merge --no-ff "$RELEASE_BRANCH" -m "chore: merge ${RELEASE_BRANCH} into main" + + release_continue "git tag -am \"${RELEASE_BRANCH}\" \"$NEW_TAG_WITH_V\"" git tag -am "${RELEASE_BRANCH}" "$NEW_TAG_WITH_V" - echo "git tag -am \"${RELEASE_BRANCH}\" \"$NEW_TAG_WITH_V\"" + + release_continue "git push --atomic origin main \"$NEW_TAG_WITH_V\"" git push --atomic origin main "$NEW_TAG_WITH_V" + + release_continue "git checkout dev" git checkout dev + + release_continue "git merge --no-ff main -m 'chore: merge main into dev'" git merge --no-ff main -m 'chore: merge main into dev' + + release_continue "git push origin dev" git push origin dev + + release_continue "git branch -d \"$RELEASE_BRANCH\"" git branch -d "$RELEASE_BRANCH" }