|
| 1 | +name: Build GUI Linux |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_run: |
| 5 | + workflows: ["Build Linux"] |
| 6 | + types: |
| 7 | + - completed |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +jobs: |
| 11 | + build-gui-linux: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + steps: |
| 15 | + - name: Check workflow run conclusion |
| 16 | + if: ${{ github.event.workflow_run.conclusion != 'success' }} |
| 17 | + run: | |
| 18 | + echo "Core build workflow failed or was cancelled" |
| 19 | + exit 1 |
| 20 | + |
| 21 | + - name: Checkout repository |
| 22 | + uses: actions/checkout@v4 |
| 23 | + with: |
| 24 | + submodules: recursive |
| 25 | + |
| 26 | + - name: Download Linux binaries |
| 27 | + uses: dawidd6/action-download-artifact@v3 |
| 28 | + with: |
| 29 | + name: ginan-linux-x64 |
| 30 | + path: bin/ |
| 31 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 32 | + workflow: build-linux.yml |
| 33 | + workflow_conclusion: success |
| 34 | + if_no_artifact_found: fail |
| 35 | + |
| 36 | + - name: Setup Python |
| 37 | + uses: actions/setup-python@v5 |
| 38 | + with: |
| 39 | + python-version: '3.11' |
| 40 | + |
| 41 | + - name: Install Python dependencies |
| 42 | + run: | |
| 43 | + pip install -r scripts/GinanUI/requirements.txt |
| 44 | + pip install pyinstaller |
| 45 | + |
| 46 | + - name: Convert UI files to Python |
| 47 | + working-directory: scripts/GinanUI |
| 48 | + run: | |
| 49 | + pyside6-uic app/views/main_window.ui -o app/views/main_window_ui.py |
| 50 | + # Fix import path in generated file |
| 51 | + sed -i '23s/.*/from scripts.GinanUI.app.resources import ginan_logo_rc/' app/views/main_window_ui.py |
| 52 | + |
| 53 | + - name: Make binaries executable |
| 54 | + run: chmod +x bin/* |
| 55 | + |
| 56 | + - name: Build GUI with PyInstaller |
| 57 | + run: | |
| 58 | + pyinstaller --name GinanUI \ |
| 59 | + --windowed \ |
| 60 | + --add-data "scripts/GinanUI/app:app" \ |
| 61 | + --add-data "scripts/plot_pos.py:scripts" \ |
| 62 | + --add-binary "bin/*:bin" \ |
| 63 | + --hidden-import PySide6 \ |
| 64 | + --hidden-import PySide6.QtWebEngineWidgets \ |
| 65 | + --hidden-import PySide6.QtWebEngineCore \ |
| 66 | + --hidden-import plotly \ |
| 67 | + --hidden-import scripts.plot_pos \ |
| 68 | + --hidden-import scripts.GinanUI.app \ |
| 69 | + --hidden-import scripts.GinanUI.app.models \ |
| 70 | + --hidden-import scripts.GinanUI.app.models.execution \ |
| 71 | + --hidden-import scripts.GinanUI.app.controllers \ |
| 72 | + --hidden-import scripts.GinanUI.app.controllers.input_controller \ |
| 73 | + --hidden-import scripts.GinanUI.app.controllers.visualisation_controller \ |
| 74 | + --hidden-import scripts.GinanUI.app.utils \ |
| 75 | + --hidden-import scripts.GinanUI.app.utils.workers \ |
| 76 | + --hidden-import scripts.GinanUI.app.utils.cddis_credentials \ |
| 77 | + --hidden-import scripts.GinanUI.app.utils.cddis_email \ |
| 78 | + --hidden-import scripts.GinanUI.app.utils.common_dirs \ |
| 79 | + --hidden-import scripts.GinanUI.app.utils.gn_functions \ |
| 80 | + --hidden-import scripts.GinanUI.app.utils.yaml \ |
| 81 | + --hidden-import scripts.GinanUI.app.views.main_window_ui \ |
| 82 | + --collect-all scripts.GinanUI \ |
| 83 | + scripts/GinanUI/main.py |
| 84 | + |
| 85 | + - name: Upload GUI artifact |
| 86 | + uses: actions/upload-artifact@v4 |
| 87 | + with: |
| 88 | + name: ginan-gui-linux-x64 |
| 89 | + path: dist/GinanUI/ |
| 90 | + retention-days: 30 |
0 commit comments