Build with Nuitka #32
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 with Nuitka | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| run: | | |
| sudo apt install python3 python-is-python3 | |
| shell: bash | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install --upgrade nuitka | |
| sudo apt-get update | |
| sudo apt-get install -y patchelf unzip | |
| shell: bash | |
| - name: Build Linux Executable | |
| run: | | |
| nuitka --standalone --onefile --output-dir=build --include-data-dir=res=res main.pyw | |
| shell: bash | |
| - name: Upload Linux Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-linux | |
| path: build/* | |
| build-linux-old: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| run: | | |
| sudo apt install python3 python-is-python3 | |
| shell: bash | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install --upgrade nuitka | |
| sudo apt-get update | |
| sudo apt-get install -y patchelf unzip | |
| shell: bash | |
| - name: Build Linux Executable | |
| run: | | |
| nuitka --standalone --onefile --output-dir=build --include-data-dir=res=res main.pyw | |
| shell: bash | |
| - name: Upload Linux Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-linux-old | |
| path: build/* | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Enable Nuitka automatic downloads | |
| run: | | |
| Write-Output "NUITKA_ALLOW_DOWNLOADS=1" >> $env:GITHUB_ENV | |
| shell: powershell | |
| - name: Upgrade pip and install project dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| if (Test-Path requirements.txt) { pip install -r requirements.txt } | |
| shell: powershell | |
| - name: Install latest Nuitka with onefile support | |
| run: | | |
| python -m pip install --upgrade "nuitka[onefile]" | |
| shell: powershell | |
| - uses: Nuitka/Nuitka-Action@main | |
| with: | |
| nuitka-version: main | |
| script-name: main.pyw | |
| include-data-dir: | | |
| res=res | |
| - name: PyInstaller Windows | |
| # You may pin to the exact commit or the version. | |
| # uses: JackMcKew/pyinstaller-action-windows@a8dee21ad01bbc7e7363d445bb632691b95ba057 | |
| uses: JackMcKew/pyinstaller-action-windows@v0.1.2 | |
| with: | |
| # Directory containing source code (optional requirements.txt). | |
| path: ./ | |
| - name: Upload Windows artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nuitka-windows-exe | |
| path: build\**\*.exe |