ci: add Windows build workflow (PyInstaller + NSIS)
- Triggers on version tags (v*) or workflow_dispatch - Builds BatchTube.exe via PyInstaller - Creates BatchTube-Setup-*.exe via NSIS - Uploads artifacts for download
This commit is contained in:
66
.github/workflows/build-windows.yml
vendored
Normal file
66
.github/workflows/build-windows.yml
vendored
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user