diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 0982bf7..28eb495 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -9,7 +9,7 @@ permissions: contents: write env: - PYTHON_VERSION: '3.12.10' + PYTHON_VERSION: '3.13.6' jobs: build-windows: @@ -147,19 +147,6 @@ jobs: if (Test-Path "build\exe.*") { Remove-Item "build\exe.*" -Recurse -Force } if (Test-Path "build\bdist.*") { Remove-Item "build\bdist.*" -Recurse -Force } - # Prepare optional FFmpeg include arguments - $ffinc1 = "" - $ffinc2 = "" - $ffinc3 = "" - if ($env:FFMPEG_PATH) { - $ffmpegExe = Join-Path $env:FFMPEG_PATH "ffmpeg.exe" - $ffprobeExe = Join-Path $env:FFMPEG_PATH "ffprobe.exe" - $ffplayExe = Join-Path $env:FFMPEG_PATH "ffplay.exe" - if (Test-Path $ffmpegExe) { $ffinc1 = "--include-files `"$ffmpegExe`"" } - if (Test-Path $ffprobeExe) { $ffinc2 = "--include-files `"$ffprobeExe`"" } - if (Test-Path $ffplayExe) { $ffinc3 = "--include-files `"$ffplayExe`"" } - } - # Build executable with FFmpeg using cx_Freeze CLI cxfreeze main.py ` --target-dir "dist\YTSage-FFmpeg" ` @@ -170,8 +157,25 @@ jobs: --packages "PySide6.QtCore,PySide6.QtGui,PySide6.QtWidgets,requests,PIL,packaging,markdown,playsound3,loguru,setuptools" ` --excludes "PySide6.QtBluetooth,PySide6.QtNetwork,PySide6.QtOpenGL,PySide6.QtPrintSupport,PySide6.QtSvg,PySide6.QtTest,PySide6.QtXml,PySide6.QtSql,PySide6.QtHelp,PySide6.QtMultimedia,PySide6.QtQml,PySide6.QtQuick,PySide6.QtWebEngineCore,PIL.ImageDraw,PIL.ImageFont,numpy,scipy,wx,pandas,tkinter,yt_dlp,unittest,test,tests" ` --include-files "src" ` - --include-files "assets" ` - $ffinc1 $ffinc2 $ffinc3 + --include-files "assets" + + # Copy FFmpeg binaries into dist folder post-build (more reliable than CLI include) + if ($env:FFMPEG_PATH) { + $destDir = "dist\YTSage-FFmpeg" + $ffmpegExe = Join-Path $env:FFMPEG_PATH "ffmpeg.exe" + $ffprobeExe = Join-Path $env:FFMPEG_PATH "ffprobe.exe" + $ffplayExe = Join-Path $env:FFMPEG_PATH "ffplay.exe" + + foreach ($file in @($ffmpegExe, $ffprobeExe, $ffplayExe)) { + if (Test-Path $file) { + $name = Split-Path $file -Leaf + Copy-Item $file -Destination (Join-Path $destDir $name) -Force + Write-Host "Copied $name into $destDir" + } else { + Write-Host "Warning: FFmpeg binary not found: $file" + } + } + } - name: Package and prepare release artifacts (ZIPs) shell: powershell