forked from ionic-team/ionic-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish.sh
executable file
·50 lines (38 loc) · 1.09 KB
/
publish.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
# Version name is "nightly" or a version number
ARG_DEFS=(
"--version-name=(.*)"
)
echo "##### "
echo "##### cdn/publish.sh"
echo "#####"
function init {
CDN_DIR=$HOME/ionic-code
../clone/clone.sh --repository="driftyco/ionic-code" \
--depth="1" \
--directory="$CDN_DIR" \
--branch="gh-pages"
}
function run {
cd ../..
VERSION_DIR=$CDN_DIR/$VERSION_NAME
VERSION=$(readJsonProp "package.json" "version")
rm -rf $VERSION_DIR
mkdir -p $VERSION_DIR
node_modules/.bin/gulp build --release --dist=$VERSION_DIR
if [[ "$VERSION_NAME" == "nightly" ]]; then
node_modules/.bin/gulp changelog --standalone \
--html=true \
--subtitle="(changes since $(git describe --tags --abbrev=0))" \
--dest="$VERSION_DIR/CHANGELOG.html" \
--from="$(git tag | grep $OLD_VERSION)"
fi
echo "-- Generating versions.json..."
cd $CDN_DIR/builder
python ./generate.py
cd $CDN_DIR
git add -A
git commit -am "release: $VERSION ($VERSION_NAME)"
git push -q origin gh-pages
echo "-- Published ionic-code v$VERSION successfully!"
}
source $(dirname $0)/../utils.inc