File tree Expand file tree Collapse file tree 4 files changed +61
-24
lines changed
Expand file tree Collapse file tree 4 files changed +61
-24
lines changed Original file line number Diff line number Diff line change 2121 run : pip install .
2222 - name : Build with PyInstaller
2323 # pyinstaller doesn't find the GTK libraries after caching?
24- run : LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu pyinstaller yafi.spec
24+ run : LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu pyinstaller yafi.spec -- --onefile
2525 working-directory : pyinstaller
2626 - name : Upload PyInstaller Artifact
2727 uses : actions/upload-artifact@v4
Original file line number Diff line number Diff line change 2323
2424 - name : Download GTK4 Gvsbuild zip
2525 if : steps.cache-gtk4.outputs.cache-hit != 'true'
26- run : Start-BitsTransfer -Source https://github.com/wingtk/gvsbuild/releases/download/2025.8 .0/GTK4_Gvsbuild_2025.8 .0_x64.zip -Destination Gvsbuild.zip
26+ run : Start-BitsTransfer -Source https://github.com/wingtk/gvsbuild/releases/download/2025.9 .0/GTK4_Gvsbuild_2025.9 .0_x64.zip -Destination Gvsbuild.zip
2727
2828 - name : Extract Gvsbuild zip
2929 if : steps.cache-gtk4.outputs.cache-hit != 'true'
@@ -41,11 +41,21 @@ jobs:
4141 - name : Build YAFI via Pip
4242 run : pip install .
4343
44- - name : Build with PyInstaller
44+ - name : Build with PyInstaller (ZIP)
4545 run : python -m PyInstaller yafi.spec
4646 working-directory : pyinstaller
4747
48- - name : Upload PyInstaller Artifact
48+ - name : Upload PyInstaller Artifact (ZIP)
49+ uses : actions/upload-artifact@v4
50+ with :
51+ path : pyinstaller/dist/YAFI/*
52+ name : yafi-windows-${{ github.sha }}
53+
54+ - name : Build with PyInstaller (EXE)
55+ run : python -m PyInstaller yafi.spec --noconfirm -- --onefile
56+ working-directory : pyinstaller
57+
58+ - name : Upload PyInstaller Artifact (EXE)
4959 uses : actions/upload-artifact@v4
5060 with :
5161 path : pyinstaller/dist/YAFI.exe
Original file line number Diff line number Diff line change 11# -*- mode: python ; coding: utf-8 -*-
22from PyInstaller .utils .hooks import collect_data_files
33import os
4+ import argparse
5+
6+ parser = argparse .ArgumentParser ()
7+ parser .add_argument ("--onefile" , action = "store_true" )
8+ options = parser .parse_args ()
49
510datas = [('LpcCrOSEC.bin' , '.' )] if os .name == 'nt' and os .path .exists ('LpcCrOSEC.bin' ) else []
611datas += collect_data_files ('yafi' )
712
8-
913a = Analysis (
1014 ['entrypoint.py' ],
1115 pathex = [],
@@ -20,25 +24,35 @@ a = Analysis(
2024 optimize = 2 ,
2125)
2226pyz = PYZ (a .pure )
23- splash = Splash (
24- 'splash.png' ,
25- binaries = a .binaries ,
26- datas = a .datas ,
27- text_pos = (4 , 480 ),
28- # Text doesn't scale on Linux, but does on Windows
29- text_size = 12 if os .name == 'nt' else 6 ,
30- minify_script = True ,
31- always_on_top = True ,
27+
28+ if options .onefile :
29+ splash = Splash (
30+ 'splash.png' ,
31+ binaries = a .binaries ,
32+ datas = a .datas ,
33+ text_pos = (4 , 480 ),
34+ # Text doesn't scale on Linux, but does on Windows
35+ text_size = 12 if os .name == 'nt' else 6 ,
36+ minify_script = True ,
37+ always_on_top = True ,
38+ )
39+
40+ exe_args = (
41+ [
42+ a .scripts ,
43+ a .binaries ,
44+ a .datas ,
45+ splash ,
46+ splash .binaries ,
47+ ]
48+ if options .onefile
49+ else [a .scripts ]
3250)
3351
3452exe = EXE (
3553 pyz ,
36- a .scripts ,
37- a .binaries ,
38- a .datas ,
39- splash ,
40- splash .binaries ,
41- [],
54+ * exe_args ,
55+ exclude_binaries = not options .onefile ,
4256 name = 'YAFI' ,
4357 debug = False ,
4458 bootloader_ignore_signals = False ,
@@ -54,3 +68,14 @@ exe = EXE(
5468 entitlements_file = None ,
5569 icon = ['yafi.ico' ],
5670)
71+
72+ if not options .onefile :
73+ coll = COLLECT (
74+ exe ,
75+ a .binaries ,
76+ a .datas ,
77+ strip = False ,
78+ upx = True ,
79+ upx_exclude = [],
80+ name = 'YAFI' ,
81+ )
Original file line number Diff line number Diff line change 1818#
1919# SPDX-License-Identifier: GPL-2.0-or-later
2020
21+ import os
2122import sys
2223import traceback
2324import threading
@@ -67,7 +68,8 @@ def do_activate(self):
6768 self .win = YafiWindow (application = self )
6869
6970 # Update the splash screen
70- if getattr (sys , 'frozen' , False ):
71+ splash = getattr (sys , 'frozen' , False ) and '_PYI_SPLASH_IPC' in os .environ
72+ if splash :
7173 import pyi_splash
7274 pyi_splash .update_text ("Detecting EC" )
7375
@@ -87,13 +89,13 @@ def do_activate(self):
8789 )
8890 self .show_error ("EC Initalisation Error" , message )
8991
90- if getattr ( sys , 'frozen' , False ) :
92+ if splash :
9193 pyi_splash .close ()
9294
9395 self .win .present ()
9496 return
9597
96- if getattr ( sys , 'frozen' , False ) :
98+ if splash :
9799 pyi_splash .update_text ("Building Interface" )
98100
99101 self .change_page (self .win .content , ThermalsPage ())
@@ -123,7 +125,7 @@ def switch_page(page):
123125
124126 self .win .navbar .connect ("row-activated" , lambda box , row : switch_page (row .get_index ()))
125127
126- if getattr ( sys , 'frozen' , False ) :
128+ if splash :
127129 pyi_splash .close ()
128130
129131 self .win .present ()
You can’t perform that action at this time.
0 commit comments