11name : build-binaries
22
33on :
4- pull_request :
5- branches : [ master ]
6- paths :
7- - ' **/*.py '
8- - ' .github/workflows/** '
9- - ' requirements.txt '
10- push :
11- branches :
12- - master
13- - ci-build-and-no-audio-asf
14- paths :
15- - ' **/*.py '
16- - ' .github/workflows/** '
17- - ' requirements.txt '
18- 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
1919
2020jobs :
2121 build :
22+ # Hard gate: only proceed if user confirmed cost
23+ if : ${{ github.event.inputs.confirm_cost == 'YES' }}
2224 name : Build PyInstaller binaries
2325 runs-on : ${{ matrix.os }}
2426 strategy :
2527 fail-fast : false
2628 matrix :
27- 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"]') }}
2830 python-version : ['3.11']
31+ env :
32+ PROFILE : ${{ github.event.inputs.profile }}
33+ BUILD_PYQT : ${{ github.event.inputs.profile == 'full' && 'true' || 'false' }}
2934 steps :
3035 - name : Checkout
3136 uses : actions/checkout@v4
3540 with :
3641 python-version : ${{ matrix.python-version }}
3742
38- - name : Install Qt dev tools (Linux only)
39- if : runner.os == 'Linux'
43+ - name : Install Qt dev tools (Linux only, full profile )
44+ if : runner.os == 'Linux' && env.BUILD_PYQT == 'true'
4045 shell : bash
4146 run : |
4247 set -euo pipefail
5358 sudo apt-get install -y --no-install-recommends libgl1 libglib2.0-0 || true
5459 fi
5560
56- - name : Check qmake (Linux only)
57- if : runner.os == 'Linux'
61+ - name : Check qmake (Linux only, full profile )
62+ if : runner.os == 'Linux' && env.BUILD_PYQT == 'true'
5863 shell : bash
5964 run : |
6065 set -euo pipefail
7075 shell : bash
7176 run : |
7277 python -m pip install --upgrade pip
73- if [ -f requirements.txt ]; then pip install -r requirements.txt; else pip install PyQt6; fi
74- # Ensure common runtime deps are available for PyInstaller analysis
75- 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
7686
7787 - name : Install Linux extras (patchelf)
7888 if : runner.os == 'Linux'
@@ -82,34 +92,35 @@ jobs:
8292 sudo apt-get update && sudo apt-get install -y patchelf
8393 fi
8494
85- - name : Build PyQt6 app
95+ - name : Build PyQt6 app (full profile only)
96+ if : env.BUILD_PYQT == 'true'
8697 shell : bash
8798 run : |
8899 pyinstaller --name ffmpeg-gui-pyqt6 --noconfirm --onefile --windowed GUI_pyqt6_WINFF.py
89100
90- - name : Build Tkinter app
101+ - name : Build Tkinter app (always)
91102 shell : bash
92103 run : |
93104 pyinstaller --name ffmpeg-gui-tkinter --noconfirm --onefile --windowed GUI_tkinter_WINFF.py
94105
95- - name : Collect artifacts
106+ - name : Collect artifacts (robust)
96107 shell : bash
97108 run : |
98109 mkdir -p artifacts
99110 arch_lc=$(echo "${{ runner.arch }}" | tr '[:upper:]' '[:lower:]')
100111 if [[ "$RUNNER_OS" == "Windows" ]]; then
101- cp dist/ffmpeg-gui-pyqt6.exe "artifacts/ffmpeg-gui-pyqt6-win-${arch_lc}.exe"
102- 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
103114 elif [[ "$RUNNER_OS" == "macOS" ]]; then
104115 # Package .app bundles as zips, suffix with architecture
105116 cd dist
106- zip -r "../artifacts/ffmpeg-gui-pyqt6-macos-${arch_lc}.app.zip" "ffmpeg-gui-pyqt6.app"
107- 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
108119 cd -
109120 else
110121 # Linux artifacts (ELF executables), suffix with architecture
111- cp dist/ffmpeg-gui-pyqt6 "artifacts/ffmpeg-gui-pyqt6-linux-${arch_lc}"
112- 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
113124 fi
114125
115126 - name : Upload artifacts
0 commit comments