Add PyInstaller Windows release build system.
Frozen builds resolve paths correctly, stage portable onedir output, and zip releases for distribution.
This commit is contained in:
51
build_release.bat
Normal file
51
build_release.bat
Normal file
@@ -0,0 +1,51 @@
|
||||
@echo off
|
||||
setlocal EnableExtensions
|
||||
title GODCWAK Release Build
|
||||
color 0B
|
||||
|
||||
cd /d "%~dp0\.."
|
||||
|
||||
echo.
|
||||
echo =========================================
|
||||
echo GODCWAK - Windows Release Build
|
||||
echo =========================================
|
||||
echo.
|
||||
|
||||
set PYTHON_EXE=
|
||||
set PYTHON_ARGS=
|
||||
if exist ".venv\Scripts\python.exe" (
|
||||
set "PYTHON_EXE=.venv\Scripts\python.exe"
|
||||
) else (
|
||||
py -3 --version >nul 2>&1
|
||||
if %ERRORLEVEL% EQU 0 (
|
||||
set "PYTHON_EXE=py"
|
||||
set "PYTHON_ARGS=-3"
|
||||
) else (
|
||||
set "PYTHON_EXE=python"
|
||||
)
|
||||
)
|
||||
|
||||
echo Using: %PYTHON_EXE% %PYTHON_ARGS%
|
||||
echo.
|
||||
|
||||
"%PYTHON_EXE%" %PYTHON_ARGS% -m pip install -q -r requirements-build.txt
|
||||
if %ERRORLEVEL% NEQ 0 (
|
||||
echo [ERROR] Failed to install build dependencies.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
"%PYTHON_EXE%" %PYTHON_ARGS% build\build_release.py --clean %*
|
||||
set BUILD_EXIT=%ERRORLEVEL%
|
||||
|
||||
echo.
|
||||
if %BUILD_EXIT% EQU 0 (
|
||||
echo [OK] Release build finished.
|
||||
echo Output: dist\GODCWAK\
|
||||
echo Archive: release\
|
||||
) else (
|
||||
echo [ERROR] Build failed with exit code %BUILD_EXIT%
|
||||
)
|
||||
echo.
|
||||
pause
|
||||
exit /b %BUILD_EXIT%
|
||||
Reference in New Issue
Block a user