* chore(stack update): update the whole docsearch stack In an effort to reduce our stack diversity I am moving docsearch to: - latest eslint - prettier - webpack 2 - babel 6 (babel 7 is soon to be released, we were on babel 5) - babel-preset-env (support: IE >=9, Two latest version of evergreen browsers). - jest * chore(contrib): remove develop branch, cc @redox
79 lines
2.3 KiB
Bash
Executable file
79 lines
2.3 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
[ -z $HOTFIX ] && HOTFIX='0'
|
|
|
|
set -e # exit when error
|
|
|
|
if [[ -n $(npm owner add `npm whoami`) ]]; then
|
|
printf "Release: Not an owner of the npm repo, ask for it"
|
|
exit 1
|
|
fi
|
|
|
|
currentBranch=`git rev-parse --abbrev-ref HEAD`
|
|
if [ $currentBranch != 'master' ]; then
|
|
printf "Release: You must be on master"
|
|
exit 1
|
|
fi
|
|
|
|
if [[ -n $(git status --porcelain) ]]; then
|
|
printf "Release: Working tree is not clean (git status)"
|
|
exit 1
|
|
fi
|
|
|
|
printf "\n\nRelease: update working tree"
|
|
git pull origin master
|
|
git fetch origin --tags
|
|
|
|
printf "Release: yarn"
|
|
yarn
|
|
|
|
currentVersion=`cat package.json | json version`
|
|
|
|
# header
|
|
printf "\n\nRelease: current version is $currentVersion"
|
|
printf "\nRelease: a changelog will be generated only if a fix/feat/performance/breaking token is found in git log"
|
|
printf "\nRelease: you must choose a new ve.rs.ion (semver)"
|
|
printf "\nRelease: press q to exit the next screen\n\n"
|
|
|
|
# preview changelog
|
|
read -p "=> Release: press [ENTER] to view changes since latest version.."
|
|
|
|
# nd (markdown renderer in terminal)
|
|
# has some output going on to stderr because of node v4, no big deal
|
|
conventional-changelog -p angular | nd | less -r 2>/dev/null
|
|
|
|
# choose and bump new version
|
|
# printf "\n\nRelease: Please enter the new chosen version > "
|
|
printf "\n=> Release: please type the new chosen version > "
|
|
read -e newVersion
|
|
VERSION=$newVersion babel-node ./scripts/bump-package-version.js
|
|
|
|
# build new version
|
|
NODE_ENV=production VERSION=$newVersion npm run build
|
|
|
|
# update changelog
|
|
printf "\n\nRelease: update changelog"
|
|
changelog=`conventional-changelog -p angular`
|
|
conventional-changelog -p angular -i CHANGELOG.md -w
|
|
|
|
# regenerate readme TOC
|
|
printf "\n\nRelease: generate TOCS"
|
|
npm run doctoc
|
|
|
|
# git add and tag
|
|
commitMessage="v$newVersion\n\n$changelog"
|
|
git add src/lib/version.js package.json CHANGELOG.md README.md CONTRIBUTING.md
|
|
printf "$commitMessage" | git commit --file -
|
|
git tag "v$newVersion"
|
|
|
|
printf "\n\nRelease: almost done, check everything in another terminal tab.\n"
|
|
read -p "=> Release: when ready, press [ENTER] to push to github and publish the package"
|
|
|
|
printf "\n\nRelease: push to github, publish on npm"
|
|
git push origin master
|
|
git push origin --tags
|
|
npm publish
|
|
|
|
printf "Release:
|
|
Package was published to npm.
|
|
A job on travis-ci will be automatically launched to finalize the release."
|