Ship and run the Go binary instead of Node
Releases now carry one archive per architecture with a static awg-control binary (services and CLI), the built frontend and .env; the installer no longer installs Node.js or runs npm. - tools/release/package.sh: CGO-free builds for linux/amd64 and arm64, version injected into `awg-control version`; used by both the GitHub and Gitea release workflows - install.sh: architecture check, per-arch archive, /usr/local/bin/awg-ctrl is a symlink to the binary, systemd unit without node in PATH, steps renumbered 1/6..6/6 - update from a Node install: the old services are stopped through the old CLI, then TS sources, node_modules and the old dist are removed; cli.env, panel.id and logs stay - README: one binary, its roles, architecture requirement
This commit is contained in:
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
# package.sh <версия> — архивы релиза: по одному на архитектуру, awgcontrol-<версия>-linux-<arch>.tar.gz.
|
||||
# Внутри: awg-control (статический Go-бинарник: сервисы и CLI), awg-ui/dist (фронтенд), .env.
|
||||
# Фронтенд должен быть собран заранее (npm run build в awg-ui). Общий для GitHub и Gitea.
|
||||
set -eu
|
||||
VERSION="$1"
|
||||
[ -f awg-ui/dist/index.html ] || { echo "нет awg-ui/dist — сначала npm run build в awg-ui"; exit 1; }
|
||||
for ARCH in amd64 arm64; do
|
||||
D="awgcontrol-${VERSION}"
|
||||
rm -rf "$D" && mkdir -p "$D/awg-ui"
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH="$ARCH" go build -trimpath -ldflags "-s -w -X main.version=${VERSION}" \
|
||||
-o "$D/awg-control" ./cmd/awg-control
|
||||
cp -r awg-ui/dist "$D/awg-ui/dist"
|
||||
cp .env "$D/"
|
||||
tar -czf "awgcontrol-${VERSION}-linux-${ARCH}.tar.gz" "$D/"
|
||||
rm -rf "$D"
|
||||
echo "awgcontrol-${VERSION}-linux-${ARCH}.tar.gz"
|
||||
done
|
||||
Reference in New Issue
Block a user