Skip to content

Commit 83328a0

Browse files
committed
Update release script
1 parent dc24f52 commit 83328a0

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

scripts/release.sh

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,37 @@
1-
#!/bin/sh
1+
#!/bin/bash -e
2+
3+
update_version() {
4+
echo "$(node -p "p=require('./${1}');p.version='${2}';JSON.stringify(p,null,2)")" > $1
5+
echo "Updated ${1} version to ${2}"
6+
}
7+
8+
current_version=$(node -p "require('./package').version")
9+
10+
printf "Next version (current is $current_version)? "
11+
read next_version
12+
13+
if ! [[ $next_version =~ ^[0-9]\.[0-9]+\.[0-9](-.+)? ]]; then
14+
echo "Version must be a valid semver string i.e. 1.0.2, 2.3.0-beta.1"
15+
exit 1
16+
fi
17+
18+
next_ref="v$next_version"
19+
20+
npm test -- --single-run
21+
22+
update_version 'package.json' $next_version
23+
update_version 'bower.json' $next_version
24+
25+
node_modules/.bin/changelog -t $next_ref
26+
227
npm run build-global
3-
node_modules/.bin/release
28+
npm run build-npm
29+
30+
git commit -am "Version $next_version"
31+
32+
git tag $next_ref
33+
git tag latest -f
34+
35+
git push origin master --tags
36+
37+
npm publish build/npm

0 commit comments

Comments
 (0)