mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Add unix build script and add to samples CI
This commit is contained in:
45
samples/PythonWXPython/build.sh
Executable file
45
samples/PythonWXPython/build.sh
Executable 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."
|
||||
Reference in New Issue
Block a user