diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 016c64c..9490f58 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,7 @@ jobs: - name: Build CLI executable run: | - pyinstaller --onefile --name nvr-export --console src/tplink_nvr_export/cli.py + pyinstaller --onefile --name nvr-export --console --collect-submodules tplink_nvr_export nvr_export_cli.py - name: Test executable run: | @@ -55,7 +55,7 @@ jobs: - name: Build GUI executable run: | - pyinstaller --onefile --name nvr-export-gui --windowed --icon=NONE src/tplink_nvr_export/gui.py + pyinstaller --onefile --name nvr-export-gui --windowed --collect-submodules tplink_nvr_export nvr_export_gui.py - name: Upload artifact uses: actions/upload-artifact@v4 @@ -81,7 +81,7 @@ jobs: - name: Build CLI executable run: | - pyinstaller --onefile --name nvr-export --console src/tplink_nvr_export/cli.py + pyinstaller --onefile --name nvr-export --console --collect-submodules tplink_nvr_export nvr_export_cli.py - name: Make executable run: chmod +x dist/nvr-export diff --git a/nvr_export_cli.py b/nvr_export_cli.py new file mode 100644 index 0000000..1d71c14 --- /dev/null +++ b/nvr_export_cli.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 +"""Entry point for CLI executable (PyInstaller compatible).""" + +import sys +from pathlib import Path + +# Add src to path for PyInstaller +src_path = Path(__file__).parent / "src" +if src_path.exists(): + sys.path.insert(0, str(src_path)) + +from tplink_nvr_export.cli import main + +if __name__ == "__main__": + main() diff --git a/nvr_export_gui.py b/nvr_export_gui.py new file mode 100644 index 0000000..c88d9e7 --- /dev/null +++ b/nvr_export_gui.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 +"""Entry point for GUI executable (PyInstaller compatible).""" + +import sys +from pathlib import Path + +# Add src to path for PyInstaller +src_path = Path(__file__).parent / "src" +if src_path.exists(): + sys.path.insert(0, str(src_path)) + +from tplink_nvr_export.gui import main + +if __name__ == "__main__": + main()