forked from as-ideas/oil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·36 lines (28 loc) · 1.29 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
#!/usr/bin/env bash
echo "\n### Installing dependencies"
npm i || exit 1
PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]')
echo "\n### Building release" $PACKAGE_VERSION$SNAPSHOT
export SNAPSHOT="-RELEASE";npm run build:release || exit 1
echo "\n### Copying to release directory"
mkdir release/$PACKAGE_VERSION
cp dist/*.$PACKAGE_VERSION-RELEASE.*.js release/$PACKAGE_VERSION/
cp -r dist/docs release/$PACKAGE_VERSION/
echo "\n### Copying stats.json"
cp dist/stats.json release/$PACKAGE_VERSION/
echo "\n### Copying and versioning hub.html"
cp src/hub.html release/$PACKAGE_VERSION/
HUB_HTML=$(cat release/$PACKAGE_VERSION/hub.html)
HUB_JS=$(cat release/$PACKAGE_VERSION/hub.$PACKAGE_VERSION-RELEASE.min.js)
echo "${HUB_HTML/<!--REPLACEME-->/$HUB_JS}" > release/$PACKAGE_VERSION/hub.html
cp release/$PACKAGE_VERSION/hub.html dist/latest/hub.html
echo "\n### Copying and versioning poi-list"
cp -r dist/poi-lists release/$PACKAGE_VERSION/
mkdir dist/latest/poi-lists
cp dist/poi-lists/default.json dist/latest/poi-lists/default.json
echo "\n### Increasing patch version"
git add *
git commit -am "Adding new release $PACKAGE_VERSION$SNAPSHOT" --no-edit
git tag -a $PACKAGE_VERSION
git push origin $PACKAGE_VERSION
#npm version patch