Correct indenttation in build_gui.yaml #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build GUI | ||
on: | ||
push: | ||
branches: [ "develop"] | ||
# paths: ['.github/workflows/**', 'build_gui.yaml'] | ||
pull_request: | ||
branches: [ "develop"] | ||
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 | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libgl1-mesa-glx libegl1-mesa libxkbcommon-x11-0 libdbus-1-3 | ||
- 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 | ||
run: | | ||
# Copy the file in a cross-platform way | ||
if [[ "$RUNNER_OS" == "Windows" ]]; then | ||
copy .\trouver\app\__init__.py .\trouver_gui.py | ||
else | ||
cp ./trouver/app/__init__.py ./trouver_gui.py | ||
fi | ||
- name: Replace relative imports in trouver_gui.py | ||
run: | | ||
python -c " | ||
import re | ||
# Read the content of the copied file | ||
with open('trouver_gui.py', 'r') as file: | ||
content = file.read() | ||
# Replace relative imports with absolute imports | ||
content = re.sub(r'^from \.\.', 'from trouver', content, flags=re.MULTILINE) | ||
# Write the modified content back to the file | ||
with open('trouver_gui.py', 'w') as file: | ||
file.write(content) | ||
" | ||
- 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* |