forked from v2rayA/v2rayA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·23 lines (21 loc) · 858 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
#!/bin/bash
set -ex
CurrentDir="$(pwd)"
if [ -d "$CurrentDir/.git" ]; then
date=$(git -C "$CurrentDir" log -1 --format="�" --date=short | sed s/-//g)
count=$(git -C "$CurrentDir" rev-list --count HEAD)
commit=$(git -C "$CurrentDir" rev-parse --short HEAD)
version="unstable-$date.r${count}.$commit"
else
version="unstable"
fi
# https://github.com/webpack/webpack/issues/14532#issuecomment-947012063
export NODE_OPTIONS=--openssl-legacy-provider
cd "$CurrentDir"/gui && yarn && OUTPUT_DIR="$CurrentDir"/service/server/router/web yarn build
for file in $(find "$CurrentDir"/service/server/router/web |grep -v png |grep -v index.html|grep -v .gz)
do
if [ ! -d $file ];then
gzip -9 $file
fi
done
cd "$CurrentDir"/service && CGO_ENABLED=0 go build -ldflags "-X github.com/v2rayA/v2rayA/conf.Version=$version -s -w" -o "$CurrentDir"/v2raya