Skip to content

Commit

Permalink
[No-ticket] release script revision to order tagging differently (#2041)
Browse files Browse the repository at this point in the history
* updating release script to do things in the right order

* Publish

 - @cmsgov/design-system-docs@4.0.0
 - @cmsgov/design-system-scripts@4.0.0
 - @cmsgov/design-system@4.0.0
 - @cmsgov/cms-design-system-docs@4.0.0
 - @cmsgov/ds-healthcare-gov@8.0.0
 - @cmsgov/ds-medicare-gov@6.0.0

* should be reverting as well

* Revert "Publish"

This reverts commit 8f06e5b.
  • Loading branch information
forrestbaer committed Aug 11, 2022
1 parent 5838e9f commit 39b7a94
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions scripts/release.sh
Expand Up @@ -50,7 +50,7 @@ if [ "$DELETE_LAST" = true ]; then
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "${GREEN}Undoing last release...${NC}"
echo "${GREEN}Removing last set of tags...${NC}"
git tag -d $TAGS
git push origin --delete $TAGS
echo "${GREEN}Tags deleted...${NC}"
Expand All @@ -61,6 +61,7 @@ if [ "$DELETE_LAST" = true ]; then
exit 0
fi

# bump current versions in active branch
echo "${GREEN}Bumping package versions...${NC}"
PRE_VERSION_HASH=$(git rev-parse HEAD)
yarn lerna version --no-push --exact ${EXTRA_OPTS[@]}
Expand All @@ -71,13 +72,26 @@ if [ "$PRE_VERSION_HASH" = "$POST_VERSION_HASH" ]; then
exit 1
fi

# read tags and push to active branch
echo "${GREEN}Pushing tags and version update commit to Github...${NC}"
read_previous_commit_tags

BRANCH=$(git rev-parse --abbrev-ref HEAD)
git push --set-upstream origin $BRANCH
git push origin $TAGS

# create temporary release branch from latest commit which is tagged
# add an empty commit so it can be pushed to origin and PR'd then
# move back to previous branch so tags can be deleted with --undo
# if necessary.
echo "${GREEN}Creating temporary release branch...${NC}"
BRANCHREF=$(git rev-parse --short HEAD)
TEMP_BRANCH="release-${BRANCHREF}"
git checkout -b $TEMP_BRANCH
git commit --allow-empty -m "DS Release Bump"
git push --set-upstream origin $TEMP_BRANCH
git checkout $BRANCH

echo ""
echo "${GREEN}Release has been tagged and pushed to origin.${NC}"
echo ""
Expand All @@ -87,7 +101,7 @@ 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 "${YELLOW} 1. Create a pull request for merging \`${CYAN}$TEMP_BRANCH${YELLOW}\` into master to save the version bump${NC}."
echo ""
echo "${YELLOW} 2. Publish this release using the \`${CYAN}publish${YELLOW}\` jenkins job${NC}."
echo ""

0 comments on commit 39b7a94

Please sign in to comment.