mirror of
https://github.com/Steve-Tech/YAFI.git
synced 2026-04-19 16:50:36 +00:00
Add pyinstaller Windows CI build
This commit is contained in:
3
.github/workflows/flatpak.yml
vendored
3
.github/workflows/flatpak.yml
vendored
@@ -13,7 +13,8 @@ jobs:
|
|||||||
options: --privileged
|
options: --privileged
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
|
- name: Build Flatpak
|
||||||
|
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
|
||||||
with:
|
with:
|
||||||
bundle: yafi-${{ github.sha }}.flatpak
|
bundle: yafi-${{ github.sha }}.flatpak
|
||||||
manifest-path: au.stevetech.yafi.json
|
manifest-path: au.stevetech.yafi.json
|
||||||
|
|||||||
15
.github/workflows/pyinstaller-linux.yml
vendored
15
.github/workflows/pyinstaller-linux.yml
vendored
@@ -7,16 +7,21 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pyinstaller-linux:
|
pyinstaller-linux:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: awalsh128/cache-apt-pkgs-action@latest
|
# We shouldn't use actions/setup-python since PyGObject is compiled against the system Python
|
||||||
|
- name: Install System Dependencies
|
||||||
|
uses: awalsh128/cache-apt-pkgs-action@latest
|
||||||
with:
|
with:
|
||||||
packages: python3-gi gir1.2-gtk-4.0 gir1.2-adw-1
|
packages: python3-gi gir1.2-gtk-4.0 gir1.2-adw-1
|
||||||
version: 0
|
version: 0
|
||||||
- run: pip install pyinstaller
|
- name: Install PyInstaller
|
||||||
- run: pip install .
|
run: pip install pyinstaller
|
||||||
- run: pyinstaller yafi.spec
|
- name: Build YAFI via Pip
|
||||||
|
run: pip install .
|
||||||
|
- name: Build with PyInstaller
|
||||||
|
run: pyinstaller yafi.spec
|
||||||
working-directory: pyinstaller
|
working-directory: pyinstaller
|
||||||
- name: Upload PyInstaller Artifact
|
- name: Upload PyInstaller Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|||||||
53
.github/workflows/pyinstaller-windows.yml
vendored
Normal file
53
.github/workflows/pyinstaller-windows.yml
vendored
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
name: PyInstaller Build Windows
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pyinstaller-windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.13'
|
||||||
|
cache: 'pip'
|
||||||
|
|
||||||
|
- name: Cache GTK4
|
||||||
|
id: cache-gtk4
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: C:\gtk
|
||||||
|
key: Gvsbuild_2025.8.0
|
||||||
|
|
||||||
|
- name: Download GTK4 Gvsbuild zip
|
||||||
|
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
|
||||||
|
|
||||||
|
- name: Extract Gvsbuild zip
|
||||||
|
if: steps.cache-gtk4.outputs.cache-hit != 'true'
|
||||||
|
run: Expand-Archive -Path Gvsbuild.zip -DestinationPath C:\gtk -Force
|
||||||
|
|
||||||
|
- name: Install PyGObject wheel
|
||||||
|
run: pip install --force-reinstall (Resolve-Path C:\gtk\wheels\PyGObject*.whl) (Resolve-Path C:\gtk\wheels\pycairo*.whl)
|
||||||
|
|
||||||
|
- name: Add GTK bin to PATH
|
||||||
|
run: echo "C:\gtk\bin" | Out-File -Append -Encoding ascii $env:GITHUB_PATH
|
||||||
|
|
||||||
|
- name: Install PyInstaller
|
||||||
|
run: pip install pyinstaller
|
||||||
|
|
||||||
|
- name: Build YAFI via Pip
|
||||||
|
run: pip install .
|
||||||
|
|
||||||
|
- name: Build with PyInstaller
|
||||||
|
run: python -m PyInstaller yafi.spec
|
||||||
|
working-directory: pyinstaller
|
||||||
|
|
||||||
|
- name: Upload PyInstaller Artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
path: pyinstaller/dist/YAFI.exe
|
||||||
|
name: yafi-windows-${{ github.sha }}
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
import os
|
import os
|
||||||
os.environ["GDK_SCALE"] = "2"
|
if os.name == 'nt' and os.environ.get('GDK_SCALE') is None:
|
||||||
|
import ctypes
|
||||||
|
scale_factor = ctypes.windll.shcore.GetScaleFactorForDevice(0)
|
||||||
|
os.environ["GDK_SCALE"] = f"{scale_factor//100}"
|
||||||
|
|
||||||
from yafi import main
|
from yafi import main
|
||||||
main()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user