Add unix build script and add to samples CI

This commit is contained in:
Caelan Sayler
2025-06-26 22:38:17 +01:00
committed by Caelan
parent fee5cb2148
commit 72af62649f
3 changed files with 68 additions and 1 deletions

View File

@@ -12,18 +12,21 @@ cd %~dp0
echo.
echo Installing dependencies
uv sync
if errorlevel 1 exit /b 1
echo update_url = R"%~dp0releases" > _build_config.py
echo.
echo Building Python application
uv run pyinstaller --onedir --windowed --noconfirm main.py
if errorlevel 1 exit /b 1
echo.
echo Building Velopack Release v%~1
mkdir publish 2>nul
xcopy /E /I /Y dist\main\* publish\ >nul
vpk pack --packId VelopackPythonSampleApp --mainExe main.exe -o releases --packDir publish --packVersion %*
if errorlevel 1 exit /b 1
echo.
echo Cleaning up

45
samples/PythonWXPython/build.sh Executable file
View File

@@ -0,0 +1,45 @@
#!/bin/bash
set -e
# Find the absolute path of the script
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Check if version parameter is provided
if [ "$#" -lt 1 ]; then
echo "Version number is required."
echo "Usage: ./build.sh [version] [extra_args...]"
exit 1
fi
cd "$SCRIPT_DIR"
# Installing dependencies
echo ""
echo "Installing dependencies..."
uv sync
# Generate build config
# Note: In Python, we use r'' for raw strings. The path needs to be absolute.
echo "update_url = r'$SCRIPT_DIR/releases'" > _build_config.py
# Building Python application
echo ""
echo "Building Python application..."
uv run pyinstaller --onedir --windowed --noconfirm main.py
# Building Velopack Release
echo ""
echo "Building Velopack Release v$1..."
mkdir -p publish
cp -r dist/main/* publish/
vpk pack --packId VelopackPythonSampleApp --mainExe main -o releases --packDir publish --packVersion "$@"
# Cleaning up
echo ""
echo "Cleaning up..."
rm -rf build
rm -rf dist
rm -rf publish
rm -f main.spec
echo "Done."