Add standalone build and packaging workflow docs/scripts

This commit is contained in:
2026-03-02 17:56:13 +01:00
parent db76fbf0d2
commit 95c461eca4
9 changed files with 308 additions and 0 deletions

27
build/build_linux.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT_DIR"
PYTHON_BIN="${PYTHON_BIN:-.venv/bin/python}"
if [ ! -x "$PYTHON_BIN" ]; then
echo "❌ Python nicht gefunden: $PYTHON_BIN"
echo "💡 Erwartet wird eine Virtual Environment unter .venv"
exit 1
fi
echo "🐧 Erstelle Linux-Standalone mit PyInstaller..."
"$PYTHON_BIN" -m pip install --upgrade pip pyinstaller
"$PYTHON_BIN" -m PyInstaller \
--noconfirm \
--clean \
--name "PDFtoICS" \
--windowed \
--add-data "version.txt:." \
gui_wxpython.py
echo "✅ Fertig: dist/PDFtoICS"

27
build/build_macos.sh Normal file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT_DIR"
PYTHON_BIN="${PYTHON_BIN:-.venv/bin/python}"
if [ ! -x "$PYTHON_BIN" ]; then
echo "❌ Python nicht gefunden: $PYTHON_BIN"
echo "💡 Erwartet wird eine Virtual Environment unter .venv"
exit 1
fi
echo "🍎 Erstelle macOS-Standalone mit PyInstaller..."
"$PYTHON_BIN" -m pip install --upgrade pip pyinstaller
"$PYTHON_BIN" -m PyInstaller \
--noconfirm \
--clean \
--name "PDFtoICS" \
--windowed \
--add-data "version.txt:." \
gui_wxpython.py
echo "✅ Fertig: dist/PDFtoICS.app"

24
build/build_windows.cmd Normal file
View File

@@ -0,0 +1,24 @@
@echo off
setlocal
cd /d "%~dp0\.."
set "PYTHON_BIN=.venv\Scripts\python.exe"
if not exist "%PYTHON_BIN%" (
echo ❌ Python nicht gefunden: %PYTHON_BIN%
echo 💡 Erwartet wird eine Virtual Environment unter .venv
exit /b 1
)
echo 🪟 Erstelle Windows-Standalone mit PyInstaller...
"%PYTHON_BIN%" -m pip install --upgrade pip pyinstaller
"%PYTHON_BIN%" -m PyInstaller ^
--noconfirm ^
--clean ^
--name "PDFtoICS" ^
--windowed ^
--add-data "version.txt;." ^
gui_wxpython.py
echo ✅ Fertig: dist\PDFtoICS\PDFtoICS.exe

24
build/package_linux.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT_DIR"
APP_DIR="dist/PDFtoICS"
VERSION="$(tr -d '[:space:]' < version.txt)"
OUT_DIR="release"
ARCHIVE_NAME="PDFtoICS-linux-v${VERSION}.tar.gz"
if [ ! -d "$APP_DIR" ]; then
echo "❌ Build-Ordner nicht gefunden: $APP_DIR"
echo "💡 Bitte zuerst ausführen: ./build/build_linux.sh"
exit 1
fi
mkdir -p "$OUT_DIR"
echo "📦 Erstelle Archiv: $OUT_DIR/$ARCHIVE_NAME"
tar -czf "$OUT_DIR/$ARCHIVE_NAME" -C dist PDFtoICS
echo "✅ Fertig: $OUT_DIR/$ARCHIVE_NAME"

25
build/package_macos.sh Normal file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT_DIR"
APP_BUNDLE="dist/PDFtoICS.app"
VERSION="$(tr -d '[:space:]' < version.txt)"
OUT_DIR="release"
ARCHIVE_NAME="PDFtoICS-macos-v${VERSION}.zip"
if [ ! -d "$APP_BUNDLE" ]; then
echo "❌ App-Bundle nicht gefunden: $APP_BUNDLE"
echo "💡 Bitte zuerst ausführen: ./build/build_macos.sh"
exit 1
fi
mkdir -p "$OUT_DIR"
echo "📦 Erstelle Archiv: $OUT_DIR/$ARCHIVE_NAME"
rm -f "$OUT_DIR/$ARCHIVE_NAME"
(cd dist && zip -r "../$OUT_DIR/$ARCHIVE_NAME" "PDFtoICS.app" >/dev/null)
echo "✅ Fertig: $OUT_DIR/$ARCHIVE_NAME"

27
build/package_windows.cmd Normal file
View File

@@ -0,0 +1,27 @@
@echo off
setlocal
cd /d "%~dp0\.."
set /p VERSION=<version.txt
set "VERSION=%VERSION: =%"
if not exist "dist\PDFtoICS\PDFtoICS.exe" (
echo ❌ Build-Ausgabe nicht gefunden: dist\PDFtoICS\PDFtoICS.exe
echo 💡 Bitte zuerst ausfuehren: build\build_windows.cmd
exit /b 1
)
if not exist "release" mkdir release
set "ARCHIVE=release\PDFtoICS-windows-v%VERSION%.zip"
if exist "%ARCHIVE%" del /q "%ARCHIVE%"
echo 📦 Erstelle Archiv: %ARCHIVE%
powershell -NoProfile -Command "Compress-Archive -Path 'dist\PDFtoICS\*' -DestinationPath '%ARCHIVE%'"
if errorlevel 1 (
echo ❌ Konnte Archiv nicht erstellen
exit /b 1
)
echo ✅ Fertig: %ARCHIVE%