Created
October 1, 2020 19:14
-
-
Save pixeldrew/7199b76dadb7c036163618798917713a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BUSINESS_RELEASE=loris | |
RELEASE_DATE="October 20th, 2020" | |
## update local repo | |
git fetch | |
# housekeeping | |
# delete local branches that are merged | |
git branch --merged | egrep -v "(^\*|master|dev)" >/tmp/merged-branches && \ | |
vi /tmp/merged-branches && xargs git branch -d </tmp/merged-branches | |
# prune remote | |
git remote prune origin | |
# checkout develop | |
git checkout develop | |
git pull | |
# has there been any commits in the last 3 sprints? does the release-notes.md have a business release section? if yes continue | |
# current pkg version | |
PKG_VERSION=v`cat package.json | jq -r -c .version` | |
# does this git tag exist? | |
TAG_EXISTS=`git ls-remote --tags -q | grep $PKG_VERSION | cut -f2 -d$'\t' | cut -f3 -d '/'` | |
if [ ! -z "$TAG_EXISTS" ]; then | |
echo "tag $PKG_VERSION exists in remote, bumping minor" | |
PKG_VERSION=`npm version minor --no-git-tag-version` | |
fi | |
# This should be handled by semantic release in future | |
# validate RELEASE-NOTES.md are up to date and new version listed is +1 of VERSION | |
# change TBD to expected release date | |
sed -i "" "s/\- TBD/\- $RELEASE_DATE/g" RELEASE-NOTES.md | |
# <pkg-version>-<business-release> | |
git checkout -b release/${PKG_VERSION}-${BUSINESS_RELEASE} | |
# lock @marcel packages to tilde range (TODO) | |
# verify package.json and package-lock versions are identical by running | |
npm ci | |
git add package* RELEASE* | |
git commit -m "chore(build): release branch version bump" --no-verify | |
git push --set-upstream origin release/${PKG_VERSION}-${BUSINESS_RELEASE} --no-verify | |
git checkout develop | |
# unlock @marcel packages to caret range | |
# create new release section in RELEASE-NOTES, ## |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment