mess around with a rust agent version with just rev shell.
This commit is contained in:
@@ -4,6 +4,8 @@ set "SCRIPT_DIR=%~dp0"
|
||||
for %%I in ("%SCRIPT_DIR%..") do set "ROOT=%%~fI\"
|
||||
set "SERVER_SRC=%ROOT%Overlord-Server"
|
||||
set "CLIENT_SRC=%ROOT%Overlord-Client"
|
||||
set "LITE_SRC=%ROOT%Overlord-Lite"
|
||||
set "LITE_PLUGIN_SRC=%ROOT%plugins\rust-lite-builder"
|
||||
set "RELEASE_DIR=%ROOT%release"
|
||||
|
||||
if not exist "%SERVER_SRC%\package.json" (
|
||||
@@ -16,6 +18,16 @@ if not exist "%CLIENT_SRC%\go.mod" (
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
if not exist "%LITE_SRC%\Cargo.toml" (
|
||||
echo [error] Overlord-Lite not found at: %LITE_SRC%
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
if not exist "%LITE_PLUGIN_SRC%\config.json" (
|
||||
echo [error] Rust Lite Builder plugin not found at: %LITE_PLUGIN_SRC%
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
where bun >nul 2>&1
|
||||
if errorlevel 1 (
|
||||
echo [error] bun was not found in PATH.
|
||||
@@ -28,34 +40,34 @@ if errorlevel 1 (
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo [1/10] Building server bundle and web assets...
|
||||
echo [1/11] Building server bundle and web assets...
|
||||
pushd "%SERVER_SRC%"
|
||||
call bun install
|
||||
if errorlevel 1 goto :err
|
||||
call bun run build
|
||||
if errorlevel 1 goto :err
|
||||
echo [2/10] Compiling Windows production executable...
|
||||
echo [2/11] Compiling Windows production executable...
|
||||
call bun run build:prod:win
|
||||
if errorlevel 1 goto :err
|
||||
echo [3/10] Compiling Linux production executable...
|
||||
echo [3/11] Compiling Linux production executable...
|
||||
call bun run build:prod:linux
|
||||
if errorlevel 1 goto :err
|
||||
popd
|
||||
|
||||
echo [4/10] Skipping prebuilt client binaries ^(prod package exports client source only^)
|
||||
echo [4/11] Skipping prebuilt client binaries ^(prod package exports client source only^)
|
||||
|
||||
echo [5/10] Preparing release folder...
|
||||
echo [5/11] Preparing release folder...
|
||||
if exist "%RELEASE_DIR%" rmdir /s /q "%RELEASE_DIR%"
|
||||
mkdir "%RELEASE_DIR%"
|
||||
if errorlevel 1 goto :err
|
||||
|
||||
echo [6/10] Copying compiled server executables...
|
||||
echo [6/11] Copying compiled server executables...
|
||||
copy /Y "%SERVER_SRC%\dist\overlord-server.exe" "%RELEASE_DIR%\overlord-server.exe" >nul
|
||||
if errorlevel 1 goto :err
|
||||
copy /Y "%SERVER_SRC%\dist\overlord-server-linux-x64" "%RELEASE_DIR%\overlord-server-linux-x64" >nul
|
||||
if errorlevel 1 goto :err
|
||||
|
||||
echo [6b/10] Copying sharp native module for runtime resolution...
|
||||
echo [6b/11] Copying sharp native module for runtime resolution...
|
||||
if exist "%SERVER_SRC%\node_modules\sharp" (
|
||||
robocopy "%SERVER_SRC%\node_modules\sharp" "%RELEASE_DIR%\node_modules\sharp" /E >nul
|
||||
if errorlevel 8 goto :robocopy_err
|
||||
@@ -65,21 +77,27 @@ if exist "%SERVER_SRC%\node_modules\@img" (
|
||||
if errorlevel 8 goto :robocopy_err
|
||||
)
|
||||
|
||||
echo [7/10] Exporting Overlord-Client source for runtime builds...
|
||||
echo [7/11] Exporting Overlord-Client source for runtime builds...
|
||||
robocopy "%CLIENT_SRC%" "%RELEASE_DIR%\Overlord-Client" /E /XD build .git .vscode >nul
|
||||
if errorlevel 8 goto :robocopy_err
|
||||
|
||||
echo [8/10] Copying required public web assets...
|
||||
echo [8/11] Exporting Overlord-Lite source and Rust builder plugin...
|
||||
robocopy "%LITE_SRC%" "%RELEASE_DIR%\Overlord-Lite" /E /XD target .git .vscode >nul
|
||||
if errorlevel 8 goto :robocopy_err
|
||||
robocopy "%LITE_PLUGIN_SRC%" "%RELEASE_DIR%\plugins\rust-lite-builder" /E /XD data /XF rust-lite-builder.zip >nul
|
||||
if errorlevel 8 goto :robocopy_err
|
||||
|
||||
echo [9/11] Copying required public web assets...
|
||||
robocopy "%SERVER_SRC%\public" "%RELEASE_DIR%\public" /E >nul
|
||||
if errorlevel 8 goto :robocopy_err
|
||||
|
||||
echo [9/10] Minifying public JS, CSS, and HTML assets...
|
||||
echo [10/11] Minifying public JS, CSS, and HTML assets...
|
||||
pushd "%SERVER_SRC%"
|
||||
call bun run scripts/minify-public.ts --dir "%RELEASE_DIR%\public"
|
||||
if errorlevel 1 goto :err
|
||||
popd
|
||||
|
||||
echo [10/10] Creating runner scripts...
|
||||
echo [11/11] Creating runner scripts...
|
||||
|
||||
(
|
||||
echo @echo off
|
||||
|
||||
@@ -5,6 +5,8 @@ SCRIPT_DIR="$(cd -- "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
ROOT="$(cd -- "$SCRIPT_DIR/.." && pwd)"
|
||||
SERVER_SRC="$ROOT/Overlord-Server"
|
||||
CLIENT_SRC="$ROOT/Overlord-Client"
|
||||
LITE_SRC="$ROOT/Overlord-Lite"
|
||||
LITE_PLUGIN_SRC="$ROOT/plugins/rust-lite-builder"
|
||||
DIST_CLIENTS_SRC="$ROOT/dist-clients"
|
||||
RELEASE_DIR="$ROOT/release/prod-package"
|
||||
|
||||
@@ -18,6 +20,16 @@ if [[ ! -f "$CLIENT_SRC/go.mod" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -f "$LITE_SRC/Cargo.toml" ]]; then
|
||||
echo "[error] Overlord-Lite not found at: $LITE_SRC" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -f "$LITE_PLUGIN_SRC/config.json" ]]; then
|
||||
echo "[error] Rust Lite Builder plugin not found at: $LITE_PLUGIN_SRC" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v bun >/dev/null 2>&1; then
|
||||
echo "[error] bun was not found in PATH." >&2
|
||||
exit 1
|
||||
@@ -49,25 +61,29 @@ copy_tree_excluding() {
|
||||
fi
|
||||
}
|
||||
|
||||
echo "[1/5] Building server bundle..."
|
||||
echo "[1/6] Building server bundle..."
|
||||
pushd "$SERVER_SRC" >/dev/null
|
||||
bun install
|
||||
bun run build:css
|
||||
bun run build
|
||||
popd >/dev/null
|
||||
|
||||
echo "[2/5] Skipping prebuilt client binaries (prod package exports client source only)"
|
||||
echo "[2/6] Skipping prebuilt client binaries (prod package exports client source only)"
|
||||
|
||||
echo "[3/5] Preparing release folder..."
|
||||
echo "[3/6] Preparing release folder..."
|
||||
rm -rf "$RELEASE_DIR"
|
||||
mkdir -p "$RELEASE_DIR"
|
||||
|
||||
echo "[4/5] Exporting Overlord-Server..."
|
||||
echo "[4/6] Exporting Overlord-Server..."
|
||||
copy_tree_excluding "$SERVER_SRC" "$RELEASE_DIR/Overlord-Server" "node_modules" ".git" ".vscode"
|
||||
|
||||
echo "[5/5] Exporting Overlord-Client source for runtime builds..."
|
||||
echo "[5/6] Exporting Overlord-Client source for runtime builds..."
|
||||
copy_tree_excluding "$CLIENT_SRC" "$RELEASE_DIR/Overlord-Client" "build" ".git" ".vscode"
|
||||
|
||||
echo "[6/6] Exporting Overlord-Lite source and Rust builder plugin..."
|
||||
copy_tree_excluding "$LITE_SRC" "$RELEASE_DIR/Overlord-Lite" "target" ".git" ".vscode"
|
||||
copy_tree_excluding "$LITE_PLUGIN_SRC" "$RELEASE_DIR/Overlord-Server/plugins/rust-lite-builder" "data" "rust-lite-builder.zip"
|
||||
|
||||
if [[ -d "$DIST_CLIENTS_SRC" ]]; then
|
||||
echo "[extra] Copying prebuilt dist-clients..."
|
||||
mkdir -p "$RELEASE_DIR/dist-clients"
|
||||
|
||||
Reference in New Issue
Block a user