From 95c461eca49af617333c618d7cd3c0fe984b9c01 Mon Sep 17 00:00:00 2001 From: webfarben Date: Mon, 2 Mar 2026 17:56:13 +0100 Subject: [PATCH] Add standalone build and packaging workflow docs/scripts --- .gitignore | 6 ++ BUILD_STANDALONE.md | 147 ++++++++++++++++++++++++++++++++++++++ README.md | 1 + build/build_linux.sh | 27 +++++++ build/build_macos.sh | 27 +++++++ build/build_windows.cmd | 24 +++++++ build/package_linux.sh | 24 +++++++ build/package_macos.sh | 25 +++++++ build/package_windows.cmd | 27 +++++++ 9 files changed, 308 insertions(+) create mode 100644 BUILD_STANDALONE.md create mode 100755 build/build_linux.sh create mode 100644 build/build_macos.sh create mode 100644 build/build_windows.cmd create mode 100755 build/package_linux.sh create mode 100644 build/package_macos.sh create mode 100644 build/package_windows.cmd diff --git a/.gitignore b/.gitignore index 4a8adbf..d3167f2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,9 @@ .venv/ __pycache__/ .pdf_to_ics_config.json + +# Build artifacts +dist/ +release/ +*.spec +build/PDFtoICS/ diff --git a/BUILD_STANDALONE.md b/BUILD_STANDALONE.md new file mode 100644 index 0000000..9acf19d --- /dev/null +++ b/BUILD_STANDALONE.md @@ -0,0 +1,147 @@ +# Standalone Builds (Linux, macOS, Windows) + +Diese Anleitung erstellt eigenständige Anwendungen mit **PyInstaller** auf dem jeweiligen Zielbetriebssystem. + +## Wichtig + +- Builds müssen **nativ pro OS** erstellt werden (kein Cross-Compile mit diesen Skripten). +- Verwenden Sie eine aktive und funktionierende `.venv` im Projektordner. +- Die GUI wird aus `gui_wxpython.py` gebaut. + +--- + +## Release auf einen Blick + +### Linux + +```bash +./build/build_linux.sh +./build/package_linux.sh +``` + +### macOS + +```bash +./build/build_macos.sh +./build/package_macos.sh +``` + +### Windows + +```cmd +build\build_windows.cmd +build\package_windows.cmd +``` + +--- + +## Empfohlene Release-Reihenfolge + +1. Version erhöhen (z. B. `version.txt` und Changelog) +2. Pro Zielplattform Build + Packaging ausführen +3. Artefakte im `release/`-Ordner prüfen +4. Git-Commit erstellen und Tag setzen (z. B. `v1.2.0`) +5. Tag und Branch pushen +6. Release-Artefakte auf der Release-Seite hochladen + +Beispiel Git-Workflow: + +```bash +git add -A +git commit -m "Release x.y.z" +git tag -a vx.y.z -m "vx.y.z" +git push origin main +git push origin vx.y.z +``` + +--- + +## Linux + +```bash +chmod +x build/build_linux.sh +./build/build_linux.sh +``` + +Ergebnis: +- `dist/PDFtoICS/` (Ordner mit ausführbarer Datei) + +Optional als Release-Archiv (`.tar.gz`) verpacken: + +```bash +chmod +x build/package_linux.sh +./build/package_linux.sh +``` + +Ergebnis: +- `release/PDFtoICS-linux-v.tar.gz` + +--- + +## macOS + +```bash +chmod +x build/build_macos.sh +./build/build_macos.sh +``` + +Ergebnis: +- `dist/PDFtoICS.app` + +Hinweis: +- Für öffentliche Verteilung ist Code-Signing/Notarisierung empfohlen. + +Optional als Release-Archiv (`.zip`) verpacken: + +```bash +chmod +x build/package_macos.sh +./build/package_macos.sh +``` + +Ergebnis: +- `release/PDFtoICS-macos-v.zip` + +--- + +## Windows + +Starten Sie unter Windows: + +```cmd +build\build_windows.cmd +``` + +Ergebnis: +- `dist\PDFtoICS\PDFtoICS.exe` + +Hinweis: +- Für weniger SmartScreen-Warnungen ist Signierung empfohlen. + +Optional als Release-Archiv (`.zip`) verpacken: + +```cmd +build\package_windows.cmd +``` + +Ergebnis: +- `release\PDFtoICS-windows-v.zip` + +--- + +## Clean Build + +PyInstaller erstellt `build/` und `dist/` sowie eine `.spec` Datei im Projektverzeichnis. + +Optionales Aufräumen: + +```bash +rm -rf build dist *.spec +``` + +Unter Windows: + +```cmd +rmdir /s /q build +rmdir /s /q dist +del /q *.spec +``` diff --git a/README.md b/README.md index 3bb2698..72cf16a 100644 --- a/README.md +++ b/README.md @@ -255,5 +255,6 @@ Dieses Tool ist zur privaten Verwendung gedacht. ## 📚 Weitere Dokumentation - **[WXPYTHON_README.md](WXPYTHON_README.md)** - Ausführliche GUI-Dokumentation und wxPython-Hinweise +- **[BUILD_STANDALONE.md](BUILD_STANDALONE.md)** - Standalone-Builds für Linux, macOS und Windows - **[QUICKSTART.md](QUICKSTART.md)** - Schnellanleitung für den Import in verschiedene Kalender - **[ZUSAMMENFASSUNG.md](ZUSAMMENFASSUNG.md)** - Projekt-Übersicht und technische Details diff --git a/build/build_linux.sh b/build/build_linux.sh new file mode 100755 index 0000000..9d77091 --- /dev/null +++ b/build/build_linux.sh @@ -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" diff --git a/build/build_macos.sh b/build/build_macos.sh new file mode 100644 index 0000000..3871b05 --- /dev/null +++ b/build/build_macos.sh @@ -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" diff --git a/build/build_windows.cmd b/build/build_windows.cmd new file mode 100644 index 0000000..e02d314 --- /dev/null +++ b/build/build_windows.cmd @@ -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 diff --git a/build/package_linux.sh b/build/package_linux.sh new file mode 100755 index 0000000..0c0b57a --- /dev/null +++ b/build/package_linux.sh @@ -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" diff --git a/build/package_macos.sh b/build/package_macos.sh new file mode 100644 index 0000000..c1b5628 --- /dev/null +++ b/build/package_macos.sh @@ -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" diff --git a/build/package_windows.cmd b/build/package_windows.cmd new file mode 100644 index 0000000..6fcf72d --- /dev/null +++ b/build/package_windows.cmd @@ -0,0 +1,27 @@ +@echo off +setlocal + +cd /d "%~dp0\.." + +set /p VERSION=