Skip to content

Commit 5752bde

Browse files
Fix workflow: move spec to separate file to avoid YAML parsing issues
1 parent 94ad473 commit 5752bde

3 files changed

Lines changed: 67 additions & 79 deletions

File tree

.github/workflows/build.yml

Lines changed: 3 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
strategy:
1515
matrix:
1616
include:
17-
- os: macos-13 # Intel
17+
- os: macos-13
1818
arch: x86_64
1919
name: intel
20-
- os: macos-latest # Apple Silicon
20+
- os: macos-latest
2121
arch: arm64
2222
name: apple-silicon
2323

@@ -37,94 +37,19 @@ jobs:
3737
pip install pyinstaller PyQt6
3838
3939
- name: Build application
40-
run: |
41-
# Create optimized spec file
42-
cat > json_to_csv_multifile_pyqt.spec << 'EOF'
43-
# -*- mode: python ; coding: utf-8 -*-
44-
block_cipher = None
45-
46-
excluded_modules = [
47-
'PyQt6.QtBluetooth', 'PyQt6.QtDesigner', 'PyQt6.QtHelp',
48-
'PyQt6.QtLocation', 'PyQt6.QtMultimedia', 'PyQt6.QtMultimediaWidgets',
49-
'PyQt6.QtNetwork', 'PyQt6.QtNfc', 'PyQt6.QtOpenGL',
50-
'PyQt6.QtOpenGLWidgets', 'PyQt6.QtPdf', 'PyQt6.QtPdfWidgets',
51-
'PyQt6.QtPositioning', 'PyQt6.QtPrintSupport', 'PyQt6.QtQml',
52-
'PyQt6.QtQuick', 'PyQt6.QtQuick3D', 'PyQt6.QtQuickWidgets',
53-
'PyQt6.QtRemoteObjects', 'PyQt6.QtSensors', 'PyQt6.QtSerialPort',
54-
'PyQt6.QtSpatialAudio', 'PyQt6.QtSql', 'PyQt6.QtSvg',
55-
'PyQt6.QtSvgWidgets', 'PyQt6.QtTest', 'PyQt6.QtWebChannel',
56-
'PyQt6.QtWebEngine', 'PyQt6.QtWebEngineCore', 'PyQt6.QtWebEngineWidgets',
57-
'PyQt6.QtWebSockets', 'PyQt6.QtXml',
58-
'test', 'unittest', 'xml', 'email', 'html', 'http', 'urllib',
59-
'ssl', '_ssl', 'cryptography', 'certifi', 'PIL', 'numpy', 'matplotlib',
60-
]
61-
62-
a = Analysis(
63-
['json_to_csv_multifile_pyqt.py'],
64-
pathex=['.'],
65-
datas=[('src', 'src')],
66-
hiddenimports=['src.converters', 'src.converters.base', 'src.converters.handlers', 'src.converters.operations'],
67-
excludes=excluded_modules,
68-
optimize=2,
69-
)
70-
71-
excluded_binaries = [
72-
'QtNetwork', 'QtPdf', 'QtSvg', 'QtWebEngine', 'QtMultimedia',
73-
'QtQml', 'QtQuick', 'QtBluetooth', 'QtPositioning', 'QtSensors',
74-
'QtSerialPort', 'QtSql', 'QtTest', 'QtXml',
75-
]
76-
77-
a.binaries = [x for x in a.binaries if not any(excl in x[0] for excl in excluded_binaries)]
78-
79-
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
80-
81-
exe = EXE(
82-
pyz, a.scripts, [],
83-
exclude_binaries=True,
84-
name='FileShift',
85-
debug=False,
86-
strip=True,
87-
upx=False,
88-
console=False,
89-
)
90-
91-
coll = COLLECT(
92-
exe, a.binaries, a.zipfiles, a.datas,
93-
strip=True,
94-
upx=False,
95-
name='FileShift',
96-
)
97-
98-
app = BUNDLE(
99-
coll,
100-
name='FileShift.app',
101-
bundle_identifier='com.simplifi.fileshift',
102-
)
103-
EOF
104-
105-
# Build with optimized spec
106-
pyinstaller --clean json_to_csv_multifile_pyqt.spec
40+
run: pyinstaller --clean fileshift.spec
10741

10842
- name: Create DMG
10943
run: |
110-
# Debug: Check what was created
11144
echo "Contents of dist directory:"
11245
ls -la dist/
113-
114-
# Verify the app exists
11546
if [ ! -d "dist/FileShift.app" ]; then
11647
echo "ERROR: Application not found in dist directory"
11748
exit 1
11849
fi
119-
120-
# Create a DMG for easier distribution
12150
mkdir -p dmg_contents
12251
cp -R "dist/FileShift.app" dmg_contents/
123-
124-
# Create Applications symlink
12552
ln -s /Applications dmg_contents/Applications
126-
127-
# Create DMG
12853
hdiutil create -volname "FileShift" \
12954
-srcfolder dmg_contents \
13055
-ov -format UDZO \

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,5 @@ test_data_*
5353

5454
# PyInstaller specific
5555
*.manifest
56-
*.spec
56+
*.spec
57+
!fileshift.spec

fileshift.spec

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
# FileShift PyInstaller spec file
3+
4+
block_cipher = None
5+
6+
excluded_modules = [
7+
'PyQt6.QtBluetooth', 'PyQt6.QtDesigner', 'PyQt6.QtHelp',
8+
'PyQt6.QtLocation', 'PyQt6.QtMultimedia', 'PyQt6.QtMultimediaWidgets',
9+
'PyQt6.QtNetwork', 'PyQt6.QtNfc', 'PyQt6.QtOpenGL',
10+
'PyQt6.QtOpenGLWidgets', 'PyQt6.QtPdf', 'PyQt6.QtPdfWidgets',
11+
'PyQt6.QtPositioning', 'PyQt6.QtPrintSupport', 'PyQt6.QtQml',
12+
'PyQt6.QtQuick', 'PyQt6.QtQuick3D', 'PyQt6.QtQuickWidgets',
13+
'PyQt6.QtRemoteObjects', 'PyQt6.QtSensors', 'PyQt6.QtSerialPort',
14+
'PyQt6.QtSpatialAudio', 'PyQt6.QtSql', 'PyQt6.QtSvg',
15+
'PyQt6.QtSvgWidgets', 'PyQt6.QtTest', 'PyQt6.QtWebChannel',
16+
'PyQt6.QtWebEngine', 'PyQt6.QtWebEngineCore', 'PyQt6.QtWebEngineWidgets',
17+
'PyQt6.QtWebSockets', 'PyQt6.QtXml',
18+
'test', 'unittest', 'xml', 'email', 'html', 'http', 'urllib',
19+
'ssl', '_ssl', 'cryptography', 'certifi', 'PIL', 'numpy', 'matplotlib',
20+
]
21+
22+
a = Analysis(
23+
['json_to_csv_multifile_pyqt.py'],
24+
pathex=['.'],
25+
datas=[('src', 'src')],
26+
hiddenimports=['src.converters', 'src.converters.base', 'src.converters.handlers', 'src.converters.operations'],
27+
excludes=excluded_modules,
28+
optimize=2,
29+
)
30+
31+
excluded_binaries = [
32+
'QtNetwork', 'QtPdf', 'QtSvg', 'QtWebEngine', 'QtMultimedia',
33+
'QtQml', 'QtQuick', 'QtBluetooth', 'QtPositioning', 'QtSensors',
34+
'QtSerialPort', 'QtSql', 'QtTest', 'QtXml',
35+
]
36+
37+
a.binaries = [x for x in a.binaries if not any(excl in x[0] for excl in excluded_binaries)]
38+
39+
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
40+
41+
exe = EXE(
42+
pyz, a.scripts, [],
43+
exclude_binaries=True,
44+
name='FileShift',
45+
debug=False,
46+
strip=True,
47+
upx=False,
48+
console=False,
49+
)
50+
51+
coll = COLLECT(
52+
exe, a.binaries, a.zipfiles, a.datas,
53+
strip=True,
54+
upx=False,
55+
name='FileShift',
56+
)
57+
58+
app = BUNDLE(
59+
coll,
60+
name='FileShift.app',
61+
bundle_identifier='com.simplifi.fileshift',
62+
)

0 commit comments

Comments
 (0)