Skip to content

Build with Nuitka

Build with Nuitka #40

Workflow file for this run

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
run: |
pip install pyinstaller
mkdir "D:\a\UStoat\UStoat\build\res" 2>nul
xcopy /E /I /Y "res" "D:\a\UStoat\UStoat\build\res\"
pyinstaller --onefile --name UStoat --add-data "res;res" --distpath dist --workpath build --specpath build main.pyw
- name: Upload Windows artifact
uses: actions/upload-artifact@v4
with:
name: nuitka-windows-exe
path: build\**\*.exe
- name: Upload Windows artifact
uses: actions/upload-artifact@v4
with:
name: ustoat-exe
path: dist\*.exe