mirror of
https://github.com/Steve-Tech/YAFI.git
synced 2026-04-19 16:50:36 +00:00
Compare commits
1 Commits
a91556e3e6
...
ci_test
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52f3372701 |
2
.github/workflows/pyinstaller-linux.yml
vendored
2
.github/workflows/pyinstaller-linux.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
|||||||
run: pip install .
|
run: pip install .
|
||||||
- name: Build with PyInstaller
|
- name: Build with PyInstaller
|
||||||
# pyinstaller doesn't find the GTK libraries after caching?
|
# pyinstaller doesn't find the GTK libraries after caching?
|
||||||
run: LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu pyinstaller yafi.spec
|
run: LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu pyinstaller yafi.spec -- --onefile
|
||||||
working-directory: pyinstaller
|
working-directory: pyinstaller
|
||||||
- name: Upload PyInstaller Artifact
|
- name: Upload PyInstaller Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|||||||
18
.github/workflows/pyinstaller-windows.yml
vendored
18
.github/workflows/pyinstaller-windows.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Download GTK4 Gvsbuild zip
|
- name: Download GTK4 Gvsbuild zip
|
||||||
if: steps.cache-gtk4.outputs.cache-hit != 'true'
|
if: steps.cache-gtk4.outputs.cache-hit != 'true'
|
||||||
run: Start-BitsTransfer -Source https://github.com/wingtk/gvsbuild/releases/download/2025.8.0/GTK4_Gvsbuild_2025.8.0_x64.zip -Destination Gvsbuild.zip
|
run: Start-BitsTransfer -Source https://github.com/wingtk/gvsbuild/releases/download/2025.9.0/GTK4_Gvsbuild_2025.9.0_x64.zip -Destination Gvsbuild.zip
|
||||||
|
|
||||||
- name: Extract Gvsbuild zip
|
- name: Extract Gvsbuild zip
|
||||||
if: steps.cache-gtk4.outputs.cache-hit != 'true'
|
if: steps.cache-gtk4.outputs.cache-hit != 'true'
|
||||||
@@ -41,12 +41,22 @@ jobs:
|
|||||||
- name: Build YAFI via Pip
|
- name: Build YAFI via Pip
|
||||||
run: pip install .
|
run: pip install .
|
||||||
|
|
||||||
- name: Build with PyInstaller
|
- name: Build with PyInstaller (ZIP)
|
||||||
run: python -m PyInstaller yafi.spec
|
run: python -m PyInstaller yafi.spec
|
||||||
working-directory: pyinstaller
|
working-directory: pyinstaller
|
||||||
|
|
||||||
- name: Upload PyInstaller Artifact
|
- name: Upload PyInstaller Artifact (ZIP)
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
path: pyinstaller/dist/YAFI/*
|
||||||
|
name: yafi-windows-${{ github.sha }}
|
||||||
|
|
||||||
|
- name: Build with PyInstaller (Standalone)
|
||||||
|
run: python -m PyInstaller yafi.spec --noconfirm -- --onefile
|
||||||
|
working-directory: pyinstaller
|
||||||
|
|
||||||
|
- name: Upload PyInstaller Artifact (Standalone)
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: pyinstaller/dist/YAFI.exe
|
path: pyinstaller/dist/YAFI.exe
|
||||||
name: yafi-windows-${{ github.sha }}
|
name: yafi-windows-standalone-${{ github.sha }}
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
# -*- mode: python ; coding: utf-8 -*-
|
# -*- mode: python ; coding: utf-8 -*-
|
||||||
from PyInstaller.utils.hooks import collect_data_files
|
from PyInstaller.utils.hooks import collect_data_files
|
||||||
import os
|
import os
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument("--onefile", action="store_true")
|
||||||
|
options = parser.parse_args()
|
||||||
|
|
||||||
datas = [('LpcCrOSEC.bin', '.')] if os.name == 'nt' and os.path.exists('LpcCrOSEC.bin') else []
|
datas = [('LpcCrOSEC.bin', '.')] if os.name == 'nt' and os.path.exists('LpcCrOSEC.bin') else []
|
||||||
datas += collect_data_files('yafi')
|
datas += collect_data_files('yafi')
|
||||||
|
|
||||||
|
|
||||||
a = Analysis(
|
a = Analysis(
|
||||||
['entrypoint.py'],
|
['entrypoint.py'],
|
||||||
pathex=[],
|
pathex=[],
|
||||||
@@ -20,25 +24,35 @@ a = Analysis(
|
|||||||
optimize=2,
|
optimize=2,
|
||||||
)
|
)
|
||||||
pyz = PYZ(a.pure)
|
pyz = PYZ(a.pure)
|
||||||
splash = Splash(
|
|
||||||
'splash.png',
|
if options.onefile:
|
||||||
binaries=a.binaries,
|
splash = Splash(
|
||||||
datas=a.datas,
|
'splash.png',
|
||||||
text_pos=(4, 480),
|
binaries=a.binaries,
|
||||||
# Text doesn't scale on Linux, but does on Windows
|
datas=a.datas,
|
||||||
text_size=12 if os.name == 'nt' else 6,
|
text_pos=(4, 480),
|
||||||
minify_script=True,
|
# Text doesn't scale on Linux, but does on Windows
|
||||||
always_on_top=True,
|
text_size=12 if os.name == 'nt' else 6,
|
||||||
|
minify_script=True,
|
||||||
|
always_on_top=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
exe_args = (
|
||||||
|
[
|
||||||
|
a.scripts,
|
||||||
|
a.binaries,
|
||||||
|
a.datas,
|
||||||
|
splash,
|
||||||
|
splash.binaries,
|
||||||
|
]
|
||||||
|
if options.onefile
|
||||||
|
else [a.scripts]
|
||||||
)
|
)
|
||||||
|
|
||||||
exe = EXE(
|
exe = EXE(
|
||||||
pyz,
|
pyz,
|
||||||
a.scripts,
|
*exe_args,
|
||||||
a.binaries,
|
exclude_binaries=not options.onefile,
|
||||||
a.datas,
|
|
||||||
splash,
|
|
||||||
splash.binaries,
|
|
||||||
[],
|
|
||||||
name='YAFI',
|
name='YAFI',
|
||||||
debug=False,
|
debug=False,
|
||||||
bootloader_ignore_signals=False,
|
bootloader_ignore_signals=False,
|
||||||
@@ -54,3 +68,14 @@ exe = EXE(
|
|||||||
entitlements_file=None,
|
entitlements_file=None,
|
||||||
icon=['yafi.ico'],
|
icon=['yafi.ico'],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not options.onefile:
|
||||||
|
coll = COLLECT(
|
||||||
|
exe,
|
||||||
|
a.binaries,
|
||||||
|
a.datas,
|
||||||
|
strip=False,
|
||||||
|
upx=True,
|
||||||
|
upx_exclude=[],
|
||||||
|
name='YAFI',
|
||||||
|
)
|
||||||
|
|||||||
10
yafi/main.py
10
yafi/main.py
@@ -18,6 +18,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
import threading
|
import threading
|
||||||
@@ -67,7 +68,8 @@ class YafiApplication(Adw.Application):
|
|||||||
self.win = YafiWindow(application=self)
|
self.win = YafiWindow(application=self)
|
||||||
|
|
||||||
# Update the splash screen
|
# Update the splash screen
|
||||||
if getattr(sys, 'frozen', False):
|
splash = getattr(sys, 'frozen', False) and '_PYI_SPLASH_IPC' in os.environ
|
||||||
|
if splash:
|
||||||
import pyi_splash
|
import pyi_splash
|
||||||
pyi_splash.update_text("Detecting EC")
|
pyi_splash.update_text("Detecting EC")
|
||||||
|
|
||||||
@@ -87,13 +89,13 @@ class YafiApplication(Adw.Application):
|
|||||||
)
|
)
|
||||||
self.show_error("EC Initalisation Error", message)
|
self.show_error("EC Initalisation Error", message)
|
||||||
|
|
||||||
if getattr(sys, 'frozen', False):
|
if splash:
|
||||||
pyi_splash.close()
|
pyi_splash.close()
|
||||||
|
|
||||||
self.win.present()
|
self.win.present()
|
||||||
return
|
return
|
||||||
|
|
||||||
if getattr(sys, 'frozen', False):
|
if splash:
|
||||||
pyi_splash.update_text("Building Interface")
|
pyi_splash.update_text("Building Interface")
|
||||||
|
|
||||||
self.change_page(self.win.content, ThermalsPage())
|
self.change_page(self.win.content, ThermalsPage())
|
||||||
@@ -123,7 +125,7 @@ class YafiApplication(Adw.Application):
|
|||||||
|
|
||||||
self.win.navbar.connect("row-activated", lambda box, row: switch_page(row.get_index()))
|
self.win.navbar.connect("row-activated", lambda box, row: switch_page(row.get_index()))
|
||||||
|
|
||||||
if getattr(sys, 'frozen', False):
|
if splash:
|
||||||
pyi_splash.close()
|
pyi_splash.close()
|
||||||
|
|
||||||
self.win.present()
|
self.win.present()
|
||||||
|
|||||||
Reference in New Issue
Block a user