mirror of
https://github.com/v2rayA/v2rayA.git
synced 2024-11-25 16:34:19 +08:00
5d1670c4bc
* try to use gziped asset * optimize: use pre-compressed asset files * fix: add powershell compress
21 lines
779 B
Bash
Executable File
21 lines
779 B
Bash
Executable File
#!/bin/bash
|
|
set -ex
|
|
CWD="$(pwd)"
|
|
SHELL_FOLDER="$(dirname $(realpath $0))"
|
|
if [ -d "$SHELL_FOLDER/.git" ]; then
|
|
date=$(git -C "$SHELL_FOLDER" log -1 --format="%cd" --date=short | sed s/-//g)
|
|
count=$(git -C "$SHELL_FOLDER" rev-list --count HEAD)
|
|
commit=$(git -C "$SHELL_FOLDER" rev-parse --short HEAD)
|
|
version="unstable-$date.r${count}.$commit"
|
|
else
|
|
version="unstable"
|
|
fi
|
|
cd "$SHELL_FOLDER"/gui && yarn && OUTPUT_DIR="$SHELL_FOLDER"/service/server/router/web yarn build
|
|
for file in $(find "$SHELL_FOLDER"/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 "$SHELL_FOLDER"/service && CGO_ENABLED=0 go build -ldflags "-X github.com/v2rayA/v2rayA/conf.Version=$version -s -w" -o "$CWD"/v2raya
|