v2rayA/build.sh

16 lines
702 B
Bash
Raw Normal View History

2021-08-20 18:14:54 +08:00
#!/bin/bash
2022-09-19 21:07:16 +08:00
2021-08-20 18:14:54 +08:00
set -ex
2023-04-17 10:35:46 +08:00
CurrentDir="$(pwd)"
2022-09-19 21:07:16 +08:00
if [ -d "$CurrentDir/.git" ]; then
date=$(git -C "$CurrentDir" log -1 --format="%cd" --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
2022-11-06 14:33:38 +08:00
# https://github.com/webpack/webpack/issues/14532#issuecomment-947012063
cd "$CurrentDir"/gui && yarn --ignore-engines && OUTPUT_DIR="$CurrentDir"/service/server/router/web yarn --ignore-engines build
2023-11-25 12:43:32 +08:00
cd "$CurrentDir"/service && CGO_ENABLED=0 go build -tags "with_gvisor" -ldflags "-X github.com/v2rayA/v2rayA/conf.Version=$version -s -w" -o "$CurrentDir"/v2raya