From 75aedaf74a61ccaa5d8f4df55abe62d78577c81a Mon Sep 17 00:00:00 2001 From: Patrick Wolfert Date: Mon, 1 Nov 2021 21:25:34 -0700 Subject: [PATCH] Use one of the git tags in the example command --- release.sh | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/release.sh b/release.sh index 08ffde6a12..a979eaaeee 100755 --- a/release.sh +++ b/release.sh @@ -8,7 +8,7 @@ YELLOW='\033[0;33m' CYAN='\033[0;36m' NC='\033[0m' # No color -echo "${GREEN}Creating release branch.${NC}" +echo "${GREEN}Creating release branch...${NC}" DATE=$(date "+%Y-%m-%d") BRANCH="release-${DATE}" git checkout -b $BRANCH @@ -26,19 +26,26 @@ if [ "$PRE_VERSION_HASH" = "$POST_VERSION_HASH" ]; then fi echo "${GREEN}Pushing tag and release commit to Github...${NC}" -# git push --set-upstream origin $BRANCH -# git push origin --tags - -# echo "" -# echo "${GREEN}Release has been tagged and pushed to origin.${NC}" -# echo "" -# echo "${YELLOW}-------${NC}" -# echo "" -# echo "${YELLOW}NEXT STEPS:${NC}" -# echo "" -# echo "${YELLOW} 1. Create a pull request for merging \`${CYAN}$BRANCH${YELLOW}\` into master to save the version bump${NC}" -# echo "" -# echo "${YELLOW} 2. Publish this release to npm by running:${NC}" -# echo "" -# echo " ${CYAN}\$${NC} yarn publish-release $PACKAGE_VERSION" -# echo "" +git push --set-upstream origin $BRANCH +git push origin --tags + +# Grep the last commit message for package versions +PACKAGE_VERSIONS=$(git log -1 --pretty=%B | grep -o "@.*$") +# Take the first one we find to use in example command +PACKAGE_VERSION=$(echo "$PACKAGE_VERSIONS" | head -1) + +echo "" +echo "${GREEN}Release has been tagged and pushed to origin.${NC}" +echo "" +echo "${PACKAGE_VERSIONS}" +echo "" +echo "${YELLOW}-------${NC}" +echo "" +echo "${YELLOW}NEXT STEPS:${NC}" +echo "" +echo "${YELLOW} 1. Create a pull request for merging \`${CYAN}$BRANCH${YELLOW}\` into master to save the version bump${NC}" +echo "" +echo "${YELLOW} 2. Publish this release to npm by running:${NC}" +echo "" +echo " ${CYAN}\$${NC} yarn publish-release $PACKAGE_VERSION" +echo ""