Skip to content

Commit

Permalink
Fix if-else statements in build_gui.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
hyunjongkimmath committed Dec 27, 2024
1 parent d3dfabb commit 99c9749
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions .github/workflows/build_gui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,26 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install pyinstaller
- name: Copy __init__.py to root as trouver_gui.py
- 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: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
copy .\trouver\app\__init__.py .\trouver_gui.py
else
cp ./trouver/app/__init__.py ./trouver_gui.py
fi
powershell -Command "(Get-Content .\trouver_gui.py) -replace '^from \.\.', 'from trouver.' | Set-Content .\trouver_gui.py"
- name: Replace relative imports in trouver_gui.py
- name: Replace relative imports in trouver_gui.py (Linux/Mac)
if: runner.os != 'Windows'
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
powershell -Command "(Get-Content .\trouver_gui.py) -replace '^from \.\.', 'from trouver' | Set-Content .\trouver_gui.py"
else
sed -i 's/^from \.\./from trouver/' trouver_gui.py
fi
sed -i 's/^from \.\./from trouver./' trouver_gui.py
- name: Build with PyInstaller
run: pyinstaller --onefile trouver_gui.py
Expand Down

0 comments on commit 99c9749

Please sign in to comment.