11name : build-binaries
22
33on :
4- # Disable automatic triggers to avoid unexpected costs; run manually from the Actions tab
5- workflow_dispatch : {}
4+ # Manual only; requires explicit cost confirmation
5+ workflow_dispatch :
6+ inputs :
7+ confirm_cost :
8+ description : " Type YES to confirm you understand this build consumes CI minutes and may incur costs."
9+ required : true
10+ default : " NO"
11+ profile :
12+ description : " Build profile (minimal = low-cost emergency, full = all OS/arch)"
13+ required : true
14+ type : choice
15+ options :
16+ - minimal
17+ - full
18+ default : minimal
619
720jobs :
821 build :
22+ # Hard gate: only proceed if user confirmed cost
23+ if : ${{ github.event.inputs.confirm_cost == 'YES' }}
924 name : Build PyInstaller binaries
1025 runs-on : ${{ matrix.os }}
1126 strategy :
1227 fail-fast : false
1328 matrix :
14- os : [ windows-latest, windows-11-arm, macos-13, macos-14, ubuntu-latest, ubuntu-22.04-arm]
29+ os : ${{ fromJSON(github.event.inputs.profile == 'full' && '[" windows-latest"," windows-11-arm"," macos-13"," macos-14"," ubuntu-latest"," ubuntu-22.04-arm"]' || '["ubuntu-latest"]') }}
1530 python-version : ['3.11']
31+ env :
32+ PROFILE : ${{ github.event.inputs.profile }}
33+ BUILD_PYQT : ${{ github.event.inputs.profile == 'full' && 'true' || 'false' }}
1634 steps :
1735 - name : Checkout
1836 uses : actions/checkout@v4
2240 with :
2341 python-version : ${{ matrix.python-version }}
2442
25- - name : Install Qt dev tools (Linux only)
26- if : runner.os == 'Linux'
43+ - name : Install Qt dev tools (Linux only, full profile )
44+ if : runner.os == 'Linux' && env.BUILD_PYQT == 'true'
2745 shell : bash
2846 run : |
2947 set -euo pipefail
4058 sudo apt-get install -y --no-install-recommends libgl1 libglib2.0-0 || true
4159 fi
4260
43- - name : Check qmake (Linux only)
44- if : runner.os == 'Linux'
61+ - name : Check qmake (Linux only, full profile )
62+ if : runner.os == 'Linux' && env.BUILD_PYQT == 'true'
4563 shell : bash
4664 run : |
4765 set -euo pipefail
5775 shell : bash
5876 run : |
5977 python -m pip install --upgrade pip
60- if [ -f requirements.txt ]; then pip install -r requirements.txt; else pip install PyQt6; fi
61- # Ensure common runtime deps are available for PyInstaller analysis
62- pip install pyinstaller requests ffmpeg-python
78+ # Minimal deps for Tkinter build by default; full profile includes PyQt6
79+ if [ "$PROFILE" = "full" ]; then
80+ if [ -f requirements.txt ]; then pip install -r requirements.txt; else pip install PyQt6; fi
81+ else
82+ # Ensure no heavy GUI deps in minimal profile
83+ pip install ffmpeg-python requests || true
84+ fi
85+ pip install pyinstaller
6386
6487 - name : Install Linux extras (patchelf)
6588 if : runner.os == 'Linux'
@@ -69,34 +92,35 @@ jobs:
6992 sudo apt-get update && sudo apt-get install -y patchelf
7093 fi
7194
72- - name : Build PyQt6 app
95+ - name : Build PyQt6 app (full profile only)
96+ if : env.BUILD_PYQT == 'true'
7397 shell : bash
7498 run : |
7599 pyinstaller --name ffmpeg-gui-pyqt6 --noconfirm --onefile --windowed GUI_pyqt6_WINFF.py
76100
77- - name : Build Tkinter app
101+ - name : Build Tkinter app (always)
78102 shell : bash
79103 run : |
80104 pyinstaller --name ffmpeg-gui-tkinter --noconfirm --onefile --windowed GUI_tkinter_WINFF.py
81105
82- - name : Collect artifacts
106+ - name : Collect artifacts (robust)
83107 shell : bash
84108 run : |
85109 mkdir -p artifacts
86110 arch_lc=$(echo "${{ runner.arch }}" | tr '[:upper:]' '[:lower:]')
87111 if [[ "$RUNNER_OS" == "Windows" ]]; then
88- cp dist/ffmpeg-gui-pyqt6.exe "artifacts/ffmpeg-gui-pyqt6-win-${arch_lc}.exe"
89- cp dist/ffmpeg-gui-tkinter.exe "artifacts/ffmpeg-gui-tkinter-win-${arch_lc}.exe"
112+ [ -f dist/ffmpeg-gui-pyqt6.exe ] && cp dist/ffmpeg-gui-pyqt6.exe "artifacts/ffmpeg-gui-pyqt6-win-${arch_lc}.exe" || true
113+ [ -f dist/ffmpeg-gui-tkinter.exe ] && cp dist/ffmpeg-gui-tkinter.exe "artifacts/ffmpeg-gui-tkinter-win-${arch_lc}.exe" || true
90114 elif [[ "$RUNNER_OS" == "macOS" ]]; then
91115 # Package .app bundles as zips, suffix with architecture
92116 cd dist
93- zip -r "../artifacts/ffmpeg-gui-pyqt6-macos-${arch_lc}.app.zip" "ffmpeg-gui-pyqt6.app"
94- zip -r "../artifacts/ffmpeg-gui-tkinter-macos-${arch_lc}.app.zip" "ffmpeg-gui-tkinter.app"
117+ [ -d "ffmpeg-gui-pyqt6.app" ] && zip -r "../artifacts/ffmpeg-gui-pyqt6-macos-${arch_lc}.app.zip" "ffmpeg-gui-pyqt6.app" || true
118+ [ -d "ffmpeg-gui-tkinter.app" ] && zip -r "../artifacts/ffmpeg-gui-tkinter-macos-${arch_lc}.app.zip" "ffmpeg-gui-tkinter.app" || true
95119 cd -
96120 else
97121 # Linux artifacts (ELF executables), suffix with architecture
98- cp dist/ffmpeg-gui-pyqt6 "artifacts/ffmpeg-gui-pyqt6-linux-${arch_lc}"
99- cp dist/ffmpeg-gui-tkinter "artifacts/ffmpeg-gui-tkinter-linux-${arch_lc}"
122+ [ -f dist/ffmpeg-gui-pyqt6 ] && cp dist/ffmpeg-gui-pyqt6 "artifacts/ffmpeg-gui-pyqt6-linux-${arch_lc}" || true
123+ [ -f dist/ffmpeg-gui-tkinter ] && cp dist/ffmpeg-gui-tkinter "artifacts/ffmpeg-gui-tkinter-linux-${arch_lc}" || true
100124 fi
101125
102126 - name : Upload artifacts
0 commit comments