From ce6f3d70751d152dcbb029737f7abe587893984e Mon Sep 17 00:00:00 2001 From: Richard Aasa Date: Sun, 9 Aug 2026 15:26:01 +0300 Subject: [PATCH] Deployment script update --- deploy_web.sh | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/deploy_web.sh b/deploy_web.sh index b9fa578..d7d086e 100755 --- a/deploy_web.sh +++ b/deploy_web.sh @@ -1,17 +1,39 @@ #!/usr/bin/env bash set -euo pipefail +# Run from the project root regardless of where the script is invoked. +cd "$(dirname "$0")" + SERVER_USER="richard" SERVER_HOST="192.168.1.168" SERVER_PATH="/opt/bulloseum/data" BUILD_DIR="build/web" +# Derive the version the same way GameVersion does (single source of truth): +# numeric version from project.godot, pre-release channel from game_version.gd. +VERSION_NUMBER="$(grep -oP 'config/version="\K[^"]+' project.godot)" +CHANNEL="$(grep -oP 'const CHANNEL: String = "\K[^"]*' game_version.gd || true)" +VERSION="v${VERSION_NUMBER}" +[ -n "$CHANNEL" ] && VERSION="${VERSION}-${CHANNEL}" + +GIT_COMMIT="$(git rev-parse --short HEAD 2>/dev/null || echo unknown)" +BUILD_DATE="$(date -u +%Y-%m-%dT%H:%M:%SZ)" + +echo "building Bullosseum ${VERSION} (${GIT_COMMIT})" + mkdir -p "$BUILD_DIR" godot --headless --export-release "Web" "$BUILD_DIR/index.html" gzip -kf "$BUILD_DIR/index.wasm" +# Version stamp shipped alongside the flat build so the server records what's live. +cat > "$BUILD_DIR/version.txt" <