-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (75 loc) · 2.69 KB
/
Copy pathpython-package.yml
File metadata and controls
88 lines (75 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Build Executables
on:
workflow_dispatch:
push:
tags:
- 'v*'
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller sounddevice scipy pydub numpy
- name: Install system dependencies (Linux only)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libportaudio2 libsndfile1 libasound2t64
- name: Build with PyInstaller
shell: bash
run: |
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
SEP=";"
else
SEP=":"
fi
# === Build argument list safely with an array (this fixes the quoting bug on macOS) ===
args=(
--onedir
--name SaveWisdomRecorder
--add-data "QUESTIONS${SEP}QUESTIONS"
--collect-all sounddevice
--collect-all numpy
--collect-all scipy
--collect-binaries sounddevice # extra safety for the PortAudio dylib on macOS
--hidden-import sounddevice
--hidden-import pydub
--hidden-import numpy
--hidden-import scipy
--hidden-import scipy.io.wavfile
--hidden-import tkinter
--windowed
--clean
save_wisdom_recorder.py
)
# Only bundle _sounddevice_data on Windows + macOS (Linux uses system library)
if [[ "${{ matrix.os }}" != "ubuntu-latest" ]]; then
SOUNDDEVICE_DATA=$(python -c "import os, sounddevice;print(os.path.join(os.path.dirname(sounddevice.__file__), '_sounddevice_data'));")
args+=(--add-data "${SOUNDDEVICE_DATA}${SEP}_sounddevice_data")
echo "✓ Bundling _sounddevice_data from: $SOUNDDEVICE_DATA"
else
echo "✓ Linux build — using system libportaudio (no _sounddevice_data folder)"
fi
# Upgrade to latest PyInstaller
pip install pyinstaller --upgrade
# Show the exact command for debugging
echo "=== Running PyInstaller ==="
printf ' %s\n' "${args[@]}"
echo "==========================="
pyinstaller "${args[@]}"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: SaveWisdomRecorder-${{ matrix.os }}
path: dist/*