Files
Zakk 56e734929f build: one local build entry point and one release workflow body
build.sh and build.ps1 each built the GUI, the core and the service
their own way, and nothing in the repository ran them; build.sh passed a
with_gvisor tag no source file declares. build.sh now runs the same
commands as _build_web.yml and _build_binaries.yml, takes the version as
an argument or from git describe, and stops at the first failing step;
build.ps1 is the same sequence for PowerShell.

release_main.yml and beta_release_main.yml duplicated every release job
and had drifted (the beta looked the release up in a hard-coded
repository). Both now call _release.yml with the tag, a prerelease flag
and whether to publish to the downstream package channels.
2026-09-20 09:17:11 +10:00

30 lines
692 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
root_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
version="${1:-$(git -C "$root_dir" describe --tags --always --dirty)}"
web_dir="$root_dir/service/server/router/web"
yarn --cwd "$root_dir/gui" --check-files
yarn --cwd "$root_dir/gui" build
rm -rf "$web_dir"
mkdir -p "$web_dir"
cp -a "$root_dir/web/." "$web_dir/"
(
cd "$root_dir/core"
CGO_ENABLED=0 go build -trimpath \
-o "$root_dir/v2raya_core" \
-ldflags="-X main.Version=$version -s -w" \
./main
)
(
cd "$root_dir/service"
CGO_ENABLED=0 go build -trimpath \
-o "$root_dir/v2raya" \
-ldflags="-X github.com/v2rayA/v2rayA/conf.Version=$version -s -w"
)