Skip to content

Commit d27b275

Browse files
committed
CI safety prompts: require explicit YES and profile selection for builds/releases
- build.yml & release.yml now request cost confirmation and profile (minimal/full) - default profile is minimal (ubuntu-only, Tkinter only) - heavy PyQt steps only in full profile
1 parent 80d54f7 commit d27b275

2 files changed

Lines changed: 76 additions & 30 deletions

File tree

.github/workflows/build.yml

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,36 @@
11
name: build-binaries
22

33
on:
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

720
jobs:
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
@@ -22,8 +40,8 @@ jobs:
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
@@ -40,8 +58,8 @@ jobs:
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
@@ -57,9 +75,14 @@ jobs:
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

.github/workflows/release.yml

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,38 @@
11
name: release
22

33
on:
4-
# Manual only to fully block automatic release builds
5-
workflow_dispatch: {}
4+
# Manual only; require explicit cost confirmation
5+
workflow_dispatch:
6+
inputs:
7+
confirm_cost:
8+
description: "Type YES to confirm you understand this release 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

720
permissions:
821
contents: write
922

1023
jobs:
1124
build:
25+
if: ${{ github.event.inputs.confirm_cost == 'YES' }}
1226
name: Build release artifacts
1327
runs-on: ${{ matrix.os }}
1428
strategy:
1529
fail-fast: false
1630
matrix:
17-
os: [windows-latest, windows-11-arm, macos-13, macos-14, ubuntu-latest, ubuntu-22.04-arm]
31+
os: ${{ fromJSON(github.event.inputs.profile == 'full' && '["windows-latest","windows-11-arm","macos-13","macos-14","ubuntu-latest","ubuntu-22.04-arm"]' || '["ubuntu-latest"]') }}
1832
python-version: ['3.11']
33+
env:
34+
PROFILE: ${{ github.event.inputs.profile }}
35+
BUILD_PYQT: ${{ github.event.inputs.profile == 'full' && 'true' || 'false' }}
1936
steps:
2037
- name: Checkout
2138
uses: actions/checkout@v4
@@ -25,8 +42,8 @@ jobs:
2542
with:
2643
python-version: ${{ matrix.python-version }}
2744

28-
- name: Install Qt dev tools (Linux only)
29-
if: runner.os == 'Linux'
45+
- name: Install Qt dev tools (Linux only, full profile)
46+
if: runner.os == 'Linux' && env.BUILD_PYQT == 'true'
3047
shell: bash
3148
run: |
3249
set -euo pipefail
@@ -40,8 +57,8 @@ jobs:
4057
sudo apt-get install -y --no-install-recommends libgl1 libglib2.0-0 || true
4158
fi
4259
43-
- name: Check qmake (Linux only)
44-
if: runner.os == 'Linux'
60+
- name: Check qmake (Linux only, full profile)
61+
if: runner.os == 'Linux' && env.BUILD_PYQT == 'true'
4562
shell: bash
4663
run: |
4764
set -euo pipefail
@@ -56,8 +73,12 @@ jobs:
5673
shell: bash
5774
run: |
5875
python -m pip install --upgrade pip
59-
if [ -f requirements.txt ]; then pip install -r requirements.txt; else pip install PyQt6; fi
60-
pip install pyinstaller requests ffmpeg-python
76+
if [ "$PROFILE" = "full" ]; then
77+
if [ -f requirements.txt ]; then pip install -r requirements.txt; else pip install PyQt6; fi
78+
else
79+
pip install ffmpeg-python requests || true
80+
fi
81+
pip install pyinstaller
6182
6283
- name: Install Linux extras (patchelf)
6384
if: runner.os == 'Linux'
@@ -67,12 +88,13 @@ jobs:
6788
sudo apt-get update && sudo apt-get install -y patchelf
6889
fi
6990
70-
- name: Build PyQt6 app
91+
- name: Build PyQt6 app (full profile only)
92+
if: env.BUILD_PYQT == 'true'
7193
shell: bash
7294
run: |
7395
pyinstaller --name ffmpeg-gui-pyqt6 --noconfirm --onefile --windowed GUI_pyqt6_WINFF.py
7496
75-
- name: Build Tkinter app
97+
- name: Build Tkinter app (always)
7698
shell: bash
7799
run: |
78100
pyinstaller --name ffmpeg-gui-tkinter --noconfirm --onefile --windowed GUI_tkinter_WINFF.py

0 commit comments

Comments
 (0)