Created
October 12, 2015 13:59
-
-
Save sommestad/1e1cfed3aebc11b7b079 to your computer and use it in GitHub Desktop.
NPM: Release new version
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
#!/bin/sh | |
############################################# | |
# Run from the directory of the NPM module # | |
############################################# | |
VERSION_TYPE=$1 | |
if [ -z "$VERSION_TYPE" ]; then | |
echo "Usage: ./npm-release.sh <major|minor|patch>"; | |
exit 1; | |
fi | |
echo "Create ${VERSION_TYPE} NPM release" | |
echo "Get the latest from master..." | |
git checkout master | |
git pull | |
echo "Create NPM version (and tag)..." | |
npm version ${VERSION_TYPE} | |
echo "Push commit and tag..." | |
git push --tags && git push | |
echo "Publish to NPM..." | |
npm publish |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment