fix: create_release.sh release_continue
This commit is contained in:
+38
-6
@@ -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"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user