forked from konvajs/konva
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·89 lines (64 loc) · 2.03 KB
/
release.sh
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/usr/bin/env bash
set -e
old_version="$(git describe --abbrev=0 --tags)"
new_version=$1
old_cdn="https://unpkg.com/konva@${old_version}/konva.js"
new_cdn="https://unpkg.com/konva@${new_version}/konva.js"
old_cdn_min="https://unpkg.com/konva@${old_version}/konva.min.js"
new_cdn_min="https://unpkg.com/konva@${old_version}/konva.min.js"
# make sure new version parameter is passed
if [ -z "$1" ]
then
echo "ERROR - pass new version. usage release.sh 0.11.0"
exit 2
fi
# make sure changle log updated
while true; do
read -p "Did you update CHANGELOG.md? " yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
echo "Pulling"
git pull
echo "lint and test"
npm run lint
npm run build
echo "commit change log updates"
git commit -am "update CHANGELOG with new version" --allow-empty
echo "npm version $1 --no-git-tag-version"
npm version $1 --no-git-tag-version --allow-same-version
echo "build for $1"
npm run build
git commit -am "build for $1" --allow-empty
echo "update CDN link in REAME"
perl -i -pe "s|${old_cdn_min}|${new_cdn_min}|g" ./README.md
git commit -am "update cdn link" --allow-empty
echo "generate documentation"
npm start api
echo "create new git tag"
git tag $1
echo "archive documentation"
zip -r konva-v${new_version}-documentation.zip ./api/*
rm -r ./api
echo "documentation is generated"
echo "include konva-v${new_version}-documentation.zip into version in github"
cd ../konva
git push
git push --tags
npm publish
echo "copy konva.js into konva-site"
cp ./konva.js ../konva-site/
cd ../konva-site
echo "replace CDN links"
find source themes -exec perl -i -pe "s|${old_cdn}|${new_cdn}|g" {} +
find source themes -exec perl -i -pe "s|${old_cdn_min}|${new_cdn_min}|g" {} +
echo "regenerate site"
./deploy.sh
echo "DONE!"
echo "-------"
echo "Now you need:"
echo "create new relese in github and attach documentation https://github.com/konvajs/konva/releases"
echo "update CDN link to ${new_cdn} at http://codepen.io/lavrton/pen/myBPGo"