forked from konvajs/konva
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·104 lines (76 loc) · 2.37 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/usr/bin/env bash
set -e
old_version="$(git describe --abbrev=0 --tags)"
new_version=$1
old_cdn="https://cdn.rawgit.com/konvajs/konva/${old_version}/konva.js"
new_cdn="https://cdn.rawgit.com/konvajs/konva/${new_version}/konva.js"
old_cdn_min="https://cdn.rawgit.com/konvajs/konva/${old_version}/konva.min.js"
new_cdn_min="https://cdn.rawgit.com/konvajs/konva/${new_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 "lint and test"
npm start lint test
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
echo "build for $1"
npm start 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 "create new git tag"
git tag $1
echo "generate documentation"
npm start api
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"
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"
npm start
echo "commit site changes"
git add .
DATE=`date +%Y-%m-%d`
git commit -am "update ${DATE}" --allow-empty
git push
echo "clean previous generated site"
cd ../konvajs.github.io
rm -r ./*
echo "copy new generated files"
cp -r ../konva-site/public/* ./
git status
echo "commit and push site changes"
git add .
git commit -am "update ${DATE}"
git push
cd ../konva
git push
git push --tags
npm publish
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"