-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sh
30 lines (20 loc) · 874 Bytes
/
build.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
#!/bin/sh
#
set -e
set -o noglob
####################################################################
RUN_NUMBER=${GITHUB_RUN_NUMBER:-0}
last_tag=`git tag | sort -V | tail -n 1`
prev_tag=`git tag | sort -V | tail -n 2 | head -n 1`
git log $prev_tag..$last_tag --pretty=format:"%s" | grep -v "^release" | sed 's/^/- /' | sort > RELEASE.md
version=`echo $last_tag | sed 's/^v//'`
sed -i "s/const Version = '.*'/const Version = '$version'/" src/helper/const.ts
build_version=$((`grep -oP "BuildVersion = '\K\d+" src/helper/const.ts` + $RUN_NUMBER))
sed -i "s/const BuildVersion = '.*'/const BuildVersion = '$build_version'/" src/helper/const.ts
echo "build info - tag: $last_tag, version: $version, build: $build_version"
###########################################
if [ ! -d node_modules ] ; then
echo Installing node modules...
npm install
fi
npm run build