forked from benbucksch/jscollection
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·25 lines (20 loc) · 837 Bytes
/
Copy pathrelease.sh
File metadata and controls
executable file
·25 lines (20 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Run from app/ directory
[ ! -e release.sh ] && echo "Please run from root directory" 1>&2 && exit 1
[ ! -z "`git status --porcelain`" ] && echo "Source tree not clean" 1>&2 && exit 1
VERSION=$1
echo Building version $VERSION
[ -z $VERSION ] && echo "Please provide the new version number" 1>&2 && exit 1
perl -p -i \
-e "s|\"version\": \".*\"|\"version\": \"$VERSION\"|;" \
package.json
git commit package.json -m "Version $VERSION"
git tag -s "v$VERSION" -m $VERSION
bash ./build-commonjs.sh
npm publish
NEXTVERSION=`node -e "let v = process.argv[1].split('.'); let last = parseInt(v.pop()) + 1; console.log(v.join('.') + '.' + last);" $VERSION`-dev
perl -p -i \
-e "s|\"version\": \".*\"|\"version\": \"$NEXTVERSION\"|;" \
package.json
git commit package.json -m "Starting version $NEXTVERSION"
git push
git push --tags