Skip to content

Commit

Permalink
Release bug fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Javis Perez <javisperez@gmail.com>
  • Loading branch information
javisperez committed Jan 31, 2017
1 parent 3343ff3 commit 8678bd6
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@

PACKAGE_VERSION=`node -p -e "require('./package.json').version"`

HAS_CHANGES=`git diff | wc -l`

if [ $HAS_CHANGES -ne 0 ]; then
echo "Working directory not clean, please commit all pending files"
exit 1
fi

if [[ -z $1 ]]; then
echo "Enter new version (currently $PACKAGE_VERSION): "
read VERSION
else
VERSION=$1
fi

if [[ $VERSION == $PACKAGE_VERSION ]]; then
if [ $VERSION = $PACKAGE_VERSION ]; then
echo "No version change, exiting"
exit 1
fi
Expand All @@ -23,18 +30,21 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "* * * * * * * Releasing $VERSION * * * * * * *"
echo

# update package.json
npm version $VERSION --message "[release] $VERSION"
# update package.json version to be used in the build
npm version $VERSION --no-git-tag-version

# build
npm run build

# generate the git tag
git tag v$VERSION

# commit
git add -A
git commit -m "[build] $VERSION"

# publish
# git push origin refs/tags/v$VERSION
# git push
# npm publish
git push origin refs/tags/v$VERSION
git push
npm publish
fi

0 comments on commit 8678bd6

Please sign in to comment.