Skip to content

Commit da781b9

Browse files
committed
Automate dependency setup in GitHub Actions
- Use setup-binaries.sh in GitHub Actions to download Python runtime and FFmpeg - Remove system-level Python and FFmpeg installations in CI - Ensure actions/build.yml and actions/build-artifacts.yml use script-driven setup
1 parent 2e2926e commit da781b9

File tree

6 files changed

+46
-75
lines changed

6 files changed

+46
-75
lines changed

.github/workflows/build-artifacts.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ jobs:
3333
run: |
3434
chmod +x setup-binaries.sh
3535
./setup-binaries.sh windows
36-
cd python-runtime-windows
37-
./python.exe get-pip.py
38-
sleep 2
39-
./Scripts/pip.exe install -r ../requirements.txt
36+
# Install Python dependencies using system Python
37+
pip install -r requirements.txt
4038
4139
- name: Build Windows application
4240
run: npm run build:win

.github/workflows/build.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,8 @@ jobs:
3737
chmod +x setup-binaries.sh
3838
if [ "${{ matrix.os }}" = "windows-latest" ]; then
3939
./setup-binaries.sh windows
40-
# Install Python dependencies for Windows
41-
cd python-runtime-windows
42-
# Fix the python._pth file to include Scripts directory
43-
echo "python311.zip" > python._pth
44-
echo "." >> python._pth
45-
echo "Scripts" >> python._pth
46-
echo "Lib/site-packages" >> python._pth
47-
echo "import site" >> python._pth
48-
# Install pip
49-
./python.exe get-pip.py
50-
# Install dependencies using the Scripts/pip.exe directly
51-
./Scripts/pip.exe install -r ../requirements.txt
40+
# Install Python dependencies using system Python
41+
pip install -r requirements.txt
5242
else
5343
./setup-binaries.sh macos
5444
fi

README.md

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ The easiest way to set up all binary dependencies:
100100
- Downloads FFmpeg binary to `ffmpeg-bin/`
101101

102102
#### Windows Setup
103-
- Downloads Python embeddable package to `python-runtime-windows/`
104-
- Sets up pip and prepares for dependency installation
105103
- Downloads FFmpeg binary to `ffmpeg-bin-windows/`
104+
- Uses system Python (no bundled runtime needed)
105+
- Requires `pip install -r requirements.txt` for dependencies
106106

107107
#### Linux Setup
108108
- Creates a Python virtual environment in `python-runtime/`
@@ -115,24 +115,25 @@ After running the setup script, you'll have:
115115

116116
```
117117
├── python-runtime/ # macOS/Linux Python environment
118-
├── python-runtime-windows/ # Windows Python environment
119118
├── ffmpeg-bin/ # macOS/Linux FFmpeg binary
120119
├── ffmpeg-bin-windows/ # Windows FFmpeg binary
121120
├── audio_extractor.py # Python script for audio processing
122121
├── requirements.txt # Python dependencies
123122
└── setup-binaries.sh # Setup script
124123
```
125124

125+
Note: Windows builds use system Python, so no `python-runtime-windows/` directory is created.
126+
126127
### Windows Post-Setup
127128

128-
After running the Windows setup, manually install Python dependencies:
129+
After running the Windows setup, install Python dependencies using system Python:
129130

130131
```bash
131-
cd python-runtime-windows
132-
python get-pip.py
133-
Scripts/pip install -r ../requirements.txt
132+
pip install -r requirements.txt
134133
```
135134

135+
No additional setup required - Windows builds use system Python and bundled FFmpeg.
136+
136137
### Cross-Platform Builds
137138

138139
- Run `./setup-binaries.sh all` to set up binaries for all platforms
@@ -231,16 +232,22 @@ ollama list # if installed
231232

232233
If the automated setup doesn't work, you can manually set up the binaries:
233234

234-
#### Python Runtime
235+
#### Python Runtime (macOS/Linux only)
235236
1. Create a virtual environment: `python3 -m venv python-runtime`
236237
2. Activate it: `source python-runtime/bin/activate` (macOS/Linux)
237238
3. Install dependencies: `pip install -r requirements.txt`
238239
4. Deactivate: `deactivate`
239240

240241
#### FFmpeg
241242
1. Download from [FFmpeg website](https://ffmpeg.org/download.html)
242-
2. Extract to `ffmpeg-bin/` directory
243-
3. Ensure the binary is executable: `chmod +x ffmpeg-bin/ffmpeg`
243+
2. Extract to `ffmpeg-bin/` directory (macOS/Linux) or `ffmpeg-bin-windows/` (Windows)
244+
3. Ensure the binary is executable: `chmod +x ffmpeg-bin/ffmpeg` (macOS/Linux)
245+
246+
#### Windows Note
247+
Windows builds rely on system Python, so just ensure Python 3.8+ is installed and run:
248+
```bash
249+
pip install -r requirements.txt
250+
```
244251

245252
### Python Dependencies
246253

@@ -255,16 +262,17 @@ The app requires these Python packages (from `requirements.txt`):
255262

256263
#### Development vs Production
257264

258-
- **Development mode**: Uses system Python and FFmpeg
259-
- **Packaged app**: Uses bundled Python runtime and FFmpeg
265+
- **Development mode**: Uses system Python and FFmpeg on all platforms
266+
- **Packaged app**:
267+
- macOS/Linux: Uses bundled Python runtime and FFmpeg
268+
- Windows: Uses system Python + bundled FFmpeg
260269

261270
#### Gitignore
262271

263272
The binary directories are automatically ignored by git:
264-
- `python-runtime/`
265-
- `python-runtime-windows/`
266-
- `ffmpeg-bin/`
267-
- `ffmpeg-bin-windows/`
273+
- `python-runtime/` (macOS/Linux only)
274+
- `ffmpeg-bin/` (macOS/Linux)
275+
- `ffmpeg-bin-windows/` (Windows)
268276

269277
This keeps the repository clean while allowing developers to set up their own binaries.
270278

electron-builder.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,8 @@ asarUnpack:
2929
win:
3030
executableName: meetingvideo-transrecorder
3131
extraResources:
32-
# Windows-specific binaries (if available)
33-
- from: 'python-runtime-windows'
34-
to: 'python-runtime'
35-
filter: '**/*'
3632
- from: 'ffmpeg-bin-windows'
37-
to: 'ffmpeg-bin'
33+
to: 'ffmpeg-bin-windows'
3834
filter: '**/*'
3935
nsis:
4036
artifactName: ${name}-${version}-setup.${ext}

setup-binaries.sh

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -75,34 +75,8 @@ setup_macos() {
7575
setup_windows() {
7676
print_status "Setting up Windows binaries..."
7777

78-
if [ ! -d "python-runtime-windows" ]; then
79-
print_status "Downloading Python embeddable for Windows..."
80-
mkdir -p python-runtime-windows
81-
82-
PYTHON_VERSION="3.11.9"
83-
curl -L -o python-windows.zip "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-embed-amd64.zip"
84-
cd python-runtime-windows
85-
unzip -o ../python-windows.zip
86-
cd ..
87-
rm python-windows.zip
88-
89-
curl -L -o python-runtime-windows/get-pip.py "https://bootstrap.pypa.io/get-pip.py"
90-
91-
# Configure python._pth to include Scripts directory and enable site-packages
92-
echo "python311.zip" > python-runtime-windows/python._pth
93-
echo "." >> python-runtime-windows/python._pth
94-
echo "Scripts" >> python-runtime-windows/python._pth
95-
echo "Lib/site-packages" >> python-runtime-windows/python._pth
96-
echo "import site" >> python-runtime-windows/python._pth
97-
98-
print_success "Windows Python runtime downloaded"
99-
print_warning "Note: To install dependencies on Windows:"
100-
print_warning " cd python-runtime-windows"
101-
print_warning " python get-pip.py"
102-
print_warning " Scripts/pip install -r ../requirements.txt"
103-
else
104-
print_warning "Windows Python runtime already exists, skipping..."
105-
fi
78+
# For Windows, we only need FFmpeg - Python will be provided by the system/CI
79+
print_status "Windows builds use system Python - only setting up FFmpeg..."
10680

10781
if [ ! -d "ffmpeg-bin-windows" ]; then
10882
print_status "Downloading FFmpeg for Windows..."
@@ -115,6 +89,9 @@ setup_windows() {
11589
else
11690
print_warning "Windows FFmpeg already exists, skipping..."
11791
fi
92+
93+
print_success "Windows setup complete - uses system Python + bundled FFmpeg"
94+
print_warning "Note: Windows builds rely on system Python and pip install requirements.txt"
11895
}
11996

12097
setup_linux() {

src/main/utils/transcript.utils.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ import { generateFallbackTranscript } from './file.utils'
1010
*/
1111
function findPythonCommand(): Promise<string | null> {
1212
const commands = ['python3', 'python', 'py']
13-
13+
1414
return new Promise((resolve) => {
1515
let index = 0
16-
16+
1717
function tryNext() {
1818
if (index >= commands.length) {
1919
resolve(null)
2020
return
2121
}
22-
22+
2323
const cmd = commands[index++]
2424
const testProcess = spawn(cmd, ['--version'], { stdio: 'pipe' })
25-
25+
2626
testProcess.on('close', (code) => {
2727
if (code === 0) {
2828
console.log(`Found Python command: ${cmd}`)
@@ -31,12 +31,12 @@ function findPythonCommand(): Promise<string | null> {
3131
tryNext()
3232
}
3333
})
34-
34+
3535
testProcess.on('error', () => {
3636
tryNext()
3737
})
3838
}
39-
39+
4040
tryNext()
4141
})
4242
}
@@ -51,7 +51,7 @@ export async function extractTranscriptFromVideo(videoPath: string): Promise<str
5151
console.log('Video path:', videoPath)
5252

5353
const appPath = app.isPackaged ? process.resourcesPath : process.cwd()
54-
54+
5555
const possiblePaths = [
5656
join(appPath, 'audio_extractor.py'),
5757
join(process.cwd(), 'audio_extractor.py'),
@@ -81,11 +81,13 @@ export async function extractTranscriptFromVideo(videoPath: string): Promise<str
8181

8282
let pythonPath: string
8383
let ffmpegPath: string
84-
84+
8585
if (app.isPackaged) {
86+
// Use bundled Python and FFmpeg
8687
if (process.platform === 'win32') {
87-
pythonPath = join(process.resourcesPath, 'python-runtime', 'Scripts', 'python.exe')
88-
ffmpegPath = join(process.resourcesPath, 'ffmpeg-bin', 'ffmpeg.exe')
88+
// Windows uses system Python, not bundled Python runtime
89+
pythonPath = 'python' // Use system Python
90+
ffmpegPath = join(process.resourcesPath, 'ffmpeg-bin-windows', 'ffmpeg.exe')
8991
} else {
9092
pythonPath = join(process.resourcesPath, 'python-runtime', 'bin', 'python3')
9193
ffmpegPath = join(process.resourcesPath, 'ffmpeg-bin', 'ffmpeg')

0 commit comments

Comments
 (0)