diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml new file mode 100644 index 0000000..b1bd6e4 --- /dev/null +++ b/.github/workflows/build-windows.yml @@ -0,0 +1,66 @@ +name: BatchTube Windows Build + +on: + push: + tags: + - 'v*' + workflow_dispatch: + inputs: + version: + description: 'Version tag (e.g. v1.0.0)' + required: false + default: 'v1.0.0' + +jobs: + build-windows: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Python 3.11 + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + cd backend + pip install --upgrade pip + pip install -r requirements.txt + pip install pyinstaller + + - name: Download yt-dlp.exe + run: | + mkdir -p tools + curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe -o tools/yt-dlp.exe + + - name: Create empty database + run: | + cd backend + python -c "import sqlite3; sqlite3.connect('youtube_sipoc.db').close()" + + - name: Build Windows EXE + run: | + cd backend + pyinstaller batchtube-windows.spec --clean --noconfirm + + - name: Install NSIS + run: choco install nsis -y + + - name: Build NSIS Installer + run: makensis installer.nsi + + - name: Upload EXE artifact + uses: actions/upload-artifact@v4 + with: + name: BatchTube-Windows-EXE + path: backend/dist/BatchTube.exe + retention-days: 30 + + - name: Upload Installer artifact + uses: actions/upload-artifact@v4 + with: + name: BatchTube-Windows-Installer + path: BatchTube-Setup-*.exe + retention-days: 30