-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (71 loc) · 2.68 KB
/
build_gui.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Build GUI
on:
push:
branches: [ "build"]
# paths: ['.github/workflows/**', 'build_gui.yaml']
pull_request:
branches: [ "build"]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
# os: [windows-latest]
python-version: ['3.10']
steps:
- name: Windows-specific step for enabling long paths
if: runner.os == 'Windows'
run: |
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
# Windows-specific commands here
- name: Configure Git for long paths
if: runner.os == 'Windows'
run: git config --global core.longpaths true
- uses: fastai/workflows/nbdev-ci@master
with:
version: '3.10'
skip_test: 'true'
# The following installation is for some packages needed by PyQt6
- name: Install system dependencies
uses: ConorMacBride/install-package@v1
with:
apt: libgl1 libglx-mesa0 libegl1 libxkbcommon-x11-0 libdbus-1-3 # For Ubuntu
brew: qt # Example for macOS, replace with actual dependencies if needed
choco: vcredist140 # Example for Windows, replace with actual dependencies if needed
- name: test
if: runner.os == 'Linux'
run: |
ls
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
- name: Copy __init__.py to root as trouver_gui.py (Windows)
if: runner.os == 'Windows'
run: |
powershell -Command "Copy-Item '.\trouver\app\__init__.py' '.\trouver_gui.py'"
- name: Copy __init__.py to root as trouver_gui.py (Linux/Mac)
if: runner.os != 'Windows'
run: |
cp ./trouver/app/__init__.py ./trouver_gui.py
- name: Replace relative imports in trouver_gui.py (Windows)
if: runner.os == 'Windows'
run: |
powershell -Command "(Get-Content .\trouver_gui.py) -replace '^from \.\.', 'from trouver.' | Set-Content .\trouver_gui.py"
- name: Replace relative imports in trouver_gui.py (Linux)
if: runner.os == 'Linux'
run: |
sed -i 's/^from \.\./from trouver./' trouver_gui.py # Works on Linux
- name: Replace relative imports in trouver_gui.py (macOS)
if: runner.os == 'macOS'
run: |
sed -i '' 's/^from \.\./from trouver./' trouver_gui.py # Works on macOS
- name: Build with PyInstaller
run: pyinstaller --onefile trouver_gui.py
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: trouver-${{ matrix.os }}
path: dist/trouver*