File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/bash -e
2+
3+ changelog=node_modules/.bin/changelog
4+
5+ update_version () {
6+ echo " $( node -p " p=require('./${1} ');p.version='${2} ';JSON.stringify(p,null,2)" ) " > $1
7+ echo " Updated ${1} version to ${2} "
8+ }
9+
10+ validate_semver () {
11+ if ! [[ $1 =~ ^[0-9]\. [0-9]+\. [0-9](-.+)? ]]; then
12+ echo " Version $1 is not valid! It must be a valid semver string like 1.0.2 or 2.3.0-beta.1"
13+ exit 1
14+ fi
15+ }
16+
17+ current_version=$( node -p " require('./package').version" )
18+
19+ printf " Next version (current is $current_version )? "
20+ read next_version
21+
22+ validate_semver $next_version
23+
24+ next_ref=" v$next_version "
25+
26+ npm test -- --single-run
27+
28+ update_version ' package.json' $next_version
29+
30+ $changelog -t $next_ref
31+
32+ npm run build
33+ npm run build-umd
34+ npm run build-min
35+
36+ echo " gzipped, the UMD build is ` gzip -c lib/umd/ReactRouter.min.js | wc -c | sed -e ' s/^[[:space:]]*//' ` bytes"
37+
38+ git add -A lib
39+ git commit -am " Version $next_version "
40+
41+ git tag $next_ref
42+
43+ git push origin master
44+ git push origin $next_ref
45+
46+ npm publish --tag beta
47+
You can’t perform that action at this time.
0 commit comments