name: Build and Release on: push: tags: - 'v*' workflow_dispatch: jobs: build-windows-cli: runs-on: windows-latest steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' - name: Install dependencies run: | python -m pip install --upgrade pip pip install pyinstaller pip install -e . - name: Build CLI executable run: | pyinstaller --onefile --name nvr-export --console --collect-submodules tplink_nvr_export nvr_export_cli.py - name: Test executable run: | ./dist/nvr-export.exe --version - name: Upload artifact uses: actions/upload-artifact@v4 with: name: nvr-export-cli-windows path: dist/nvr-export.exe build-windows-gui: runs-on: windows-latest steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' - name: Install dependencies run: | python -m pip install --upgrade pip pip install pyinstaller pip install -e . - name: Build GUI executable run: | pyinstaller --onefile --name nvr-export-gui --windowed --collect-submodules tplink_nvr_export nvr_export_gui.py - name: Upload artifact uses: actions/upload-artifact@v4 with: name: nvr-export-gui-windows path: dist/nvr-export-gui.exe build-linux: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' - name: Install dependencies run: | python -m pip install --upgrade pip pip install pyinstaller pip install -e . - name: Build CLI executable run: | pyinstaller --onefile --name nvr-export --console --collect-submodules tplink_nvr_export nvr_export_cli.py - name: Make executable run: chmod +x dist/nvr-export - name: Test executable run: | ./dist/nvr-export --version - name: Upload artifact uses: actions/upload-artifact@v4 with: name: nvr-export-linux path: dist/nvr-export release: needs: [build-windows-cli, build-windows-gui, build-linux] runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') permissions: contents: write steps: - name: Download Windows CLI artifact uses: actions/download-artifact@v4 with: name: nvr-export-cli-windows path: windows-cli - name: Download Windows GUI artifact uses: actions/download-artifact@v4 with: name: nvr-export-gui-windows path: windows-gui - name: Download Linux artifact uses: actions/download-artifact@v4 with: name: nvr-export-linux path: linux - name: Rename artifacts run: | mv windows-cli/nvr-export.exe nvr-export-cli-windows.exe mv windows-gui/nvr-export-gui.exe nvr-export-gui-windows.exe mv linux/nvr-export nvr-export-linux - name: Create Release uses: softprops/action-gh-release@v1 with: files: | nvr-export-cli-windows.exe nvr-export-gui-windows.exe nvr-export-linux body: | ## Downloads | File | Description | |------|-------------| | `nvr-export-gui-windows.exe` | 🖥️ Windows GUI (double-click to run) | | `nvr-export-cli-windows.exe` | ⌨️ Windows CLI (for automation/scripts) | | `nvr-export-linux` | 🐧 Linux CLI | ### Quick Start (Windows GUI) 1. Download `nvr-export-gui-windows.exe` 2. Double-click to run 3. Enter NVR IP, credentials, and time range 4. Click "Export" generate_release_notes: true