Skip to content

Commit fc3c3d1

Browse files
committed
temporary beta release script
1 parent 88be5d5 commit fc3c3d1

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

scripts/release-beta.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+

0 commit comments

Comments
 (0)