Skip to content

Commit b12dd6f

Browse files
committed
Add release script
1 parent 1b4c888 commit b12dd6f

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
set -e
2+
3+
if [[ -z $1 ]]; then
4+
echo "Enter new version: "
5+
read VERSION
6+
else
7+
VERSION=$1
8+
fi
9+
10+
read -p "Releasing $VERSION - are you sure? (y/n) " -n 1 -r
11+
echo
12+
if [[ $REPLY =~ ^[Yy]$ ]]; then
13+
echo "Releasing $VERSION ..."
14+
15+
npm run test
16+
17+
# build
18+
npm run build
19+
20+
# commit
21+
git add -A
22+
git add -f \
23+
dist/*.js
24+
git commit -m "build: $VERSION"
25+
npm version $VERSION --message "release: $VERSION"
26+
27+
# publish
28+
git push origin refs/tags/v$VERSION
29+
git push
30+
npm publish
31+
32+
# generate release note
33+
VERSION=$VERSION npm run release:note
34+
fi

0 commit comments

Comments
 (0)