Skip to content

Commit 7e0e901

Browse files
authored
ci: Bundle vpe_gui via pyinstaller (#7)
1 parent 4548317 commit 7e0e901

4 files changed

Lines changed: 76 additions & 9 deletions

File tree

.github/workflows/pyinstaller.yml

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ permissions:
1515
contents: write
1616

1717
jobs:
18-
build:
18+
build_rfunit:
1919
runs-on: windows-latest
2020
steps:
2121
- name: Checkout code
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v6
2323

2424
- name: Setup Python
25-
uses: actions/setup-python@v4
25+
uses: actions/setup-python@v6
2626
with:
2727
python-version: '3.12'
2828

@@ -43,9 +43,9 @@ jobs:
4343
cp README_easy.txt README.txt
4444
4545
- name: Upload artifacts
46-
uses: actions/upload-artifact@v4
46+
uses: actions/upload-artifact@v6
4747
with:
48-
name: build-artifacts
48+
name: build-artifacts-rfunit
4949
path: |
5050
dist/
5151
LICENSE
@@ -55,15 +55,49 @@ jobs:
5555
pi_pico_diagram_one_s.png
5656
micropython_pico.uf2
5757
58+
build_vpe:
59+
runs-on: windows-latest
60+
defaults:
61+
run:
62+
working-directory: editor
63+
steps:
64+
- name: Checkout code
65+
uses: actions/checkout@v6
66+
67+
- name: Setup Python
68+
uses: actions/setup-python@v6
69+
with:
70+
python-version: '3.14'
71+
72+
- name: Install PyInstaller and deps
73+
run: |
74+
pip install -r requirements.txt
75+
76+
- name: Build executable
77+
run: |
78+
pyinstaller vpe_gui.spec
79+
80+
- name: Upload artifacts
81+
uses: actions/upload-artifact@v6
82+
with:
83+
name: build-artifacts-vpe
84+
path: |
85+
editor/dist/*
86+
5887
release:
5988
runs-on: ubuntu-latest
60-
needs: build
89+
needs: [build_rfunit,build_vpe]
6190
if: startsWith(github.ref, 'refs/tags/')
6291
steps:
6392
- name: Download artifacts
64-
uses: actions/download-artifact@v4
93+
uses: actions/download-artifact@v6
94+
with:
95+
name: build-artifacts-rfunit
96+
97+
- name: Download artifacts
98+
uses: actions/download-artifact@v6
6599
with:
66-
name: build-artifacts
100+
name: build-artifacts-vpe
67101

68102
- name: Create release zip
69103
run: |

editor/requirements.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
numpy>=2.4.4
2+
scipy>=1.17.1
3+
sounddevice>=0.5.5
4+
darkdetect>=0.8.0
5+
sv-ttk>=2.6.1
6+
fastcrc>=0.3.5
7+
pyinstaller>=6.19.0

editor/vpe_gui.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,9 @@ def _log_ts(self, msg):
596596
def main():
597597
root = tk.Tk()
598598
FirmwareGUI(root)
599-
sv_ttk.set_theme(darkdetect.theme())
599+
# theme detection seems flaky with pyinstaller / windows
600+
theme = darkdetect.theme() or "dark"
601+
sv_ttk.set_theme(theme)
600602
root.mainloop()
601603

602604

editor/vpe_gui.spec

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
3+
added_files = [
4+
( 'vpe.py', '.' ),
5+
]
6+
7+
a = Analysis(
8+
['vpe_gui.py'],
9+
datas=added_files,
10+
)
11+
pyz = PYZ(a.pure)
12+
13+
exe = EXE(
14+
pyz,
15+
a.scripts,
16+
a.binaries,
17+
a.zipfiles,
18+
a.datas,
19+
name='vpe_gui',
20+
debug=False,
21+
strip=False,
22+
upx=True,
23+
console=False,
24+
)

0 commit comments

Comments
 (0)