Skip to content

Commit

Permalink
Use one of the git tags in the example command
Browse files Browse the repository at this point in the history
  • Loading branch information
pwolfert committed Nov 2, 2021
1 parent 7ee98f0 commit 75aedaf
Showing 1 changed file with 24 additions and 17 deletions.
41 changes: 24 additions & 17 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ""

0 comments on commit 75aedaf

Please sign in to comment.