Mise à jour pour utiliser un autre port #4
This file contains hidden or 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 UI executables | |
| on: | |
| push: | |
| pull_request: | |
| release: | |
| types: [published] | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -r ui/requirements.txt | |
| - name: Build executable | |
| run: | | |
| # choose separator for add-data | |
| if [[ "${{ matrix.os }}" == "windows-latest" ]]; then SEP=';'; else SEP=':'; fi | |
| python -m PyInstaller --name ok_computer_ui-${{ matrix.os }} --onefile \ | |
| --add-data "ui/templates${SEP}templates" \ | |
| --add-data "ui/static${SEP}static" \ | |
| --collect-submodules flask \ | |
| --hidden-import socket \ | |
| ui/app.py | |
| shell: bash | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ok_computer_ui-${{ matrix.os }} | |
| path: dist/* | |
| - name: Upload binaries to GitHub Release | |
| if: github.event_name == 'release' | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: dist/** | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |