#!/usr/bin/env bash # Exports the Windows Desktop build against production endpoints, for Steam # release. project.godot stays checked in pointing at UAT (us3q.ranaze.com) # so the Godot editor/debugger keeps hitting UAT - this script patches a # local copy just for the export, the same way web/Dockerfile patches # project.godot for the UAT/PRD web builds, then restores the original file # even if the export fails. set -euo pipefail REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" PROJECT_FILE="${REPO_ROOT}/project.godot" BACKUP_FILE="${PROJECT_FILE}.steam-release.bak" GODOT_BIN="${GODOT_BIN:-/z/Godot/Godot_v4.6.2-stable_win64_console.exe}" OUTPUT_PATH="${1:-build/windows/RanaZe.exe}" cleanup() { if [ -f "${BACKUP_FILE}" ]; then mv -f "${BACKUP_FILE}" "${PROJECT_FILE}" fi } trap cleanup EXIT cp "${PROJECT_FILE}" "${BACKUP_FILE}" BUILD_REVISION="$(git -C "${REPO_ROOT}" rev-parse HEAD)" sed -i \ -e "s|deployment_environment=\"uat\"|deployment_environment=\"prd\"|" \ -e "s|build_revision=\"development\"|build_revision=\"${BUILD_REVISION}\"|" \ -e "s|https://us3q.ranaze.com|https://s3q.ranaze.com|g" \ "${PROJECT_FILE}" mkdir -p "${REPO_ROOT}/$(dirname "${OUTPUT_PATH}")" "${GODOT_BIN}" --headless --export-release "Windows Desktop" "${OUTPUT_PATH}" --path "${REPO_ROOT}" echo "Steam release build exported to ${OUTPUT_PATH} (production endpoints, revision ${BUILD_REVISION})."