-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:clay/amphora into modify-lists
- Loading branch information
Showing
3 changed files
with
80 additions
and
5 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
|
||
# This script will increment the package version in package.json. | ||
# It will then tag the HEAD of the master branch with the version number | ||
# and push the tag to the origin (GitHub) | ||
|
||
set -e | ||
|
||
OPTIONS="(prepatch|patch|preminor|minor|premajor|major)" | ||
USAGE="usage: npm release $OPTIONS" | ||
SEMVAR="$1" | ||
|
||
# Releases should only be cut from the master branch. | ||
# They can be manually cut from other branches, but that should be a very | ||
# intentional process. | ||
BRANCH="$(git rev-parse --abbrev-ref HEAD)" | ||
if [[ "$BRANCH" != "master" ]]; then | ||
>&2 echo "ERROR: Not on the master branch, will not release." | ||
exit 1 | ||
fi | ||
|
||
case $SEMVAR in | ||
minor) | ||
;; | ||
major) | ||
;; | ||
patch) | ||
;; | ||
premajor) | ||
;; | ||
preminor) | ||
;; | ||
prepatch) | ||
;; | ||
*) | ||
SEMVAR=prepatch | ||
>&2 echo "WARNING: No $OPTIONS provided, defaulting to PREPATCH." | ||
>&2 echo "$USAGE" | ||
;; | ||
esac | ||
|
||
git pull --rebase origin master | ||
version="$(npm version $SEMVAR)" | ||
git push origin master | ||
git push origin "tags/$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