You can build for Windows, macOS, and Linux simultaneously by using a GitHub Actions matrix strategy. This allows you to run the same compilation steps across different runs-on operating systems.
Recommended Workflow Steps:
actions/checkout@v4 to get your code.actions/setup-python@v5 to prepare the environment.- Install your project dependencies via
pip. - Run
Nuitka/Nuitka-Action@main to build the executable. actions/upload-artifact@v4 to save the resulting binaries. Note: Always set include-hidden-files: true when uploading artifacts to ensure .libs folders and other necessary hidden files are included.
jobs:
build:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check-out repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: 'x64'
cache: 'pip'
cache-dependency-path: |
**/requirements*.txt
- name: Install Dependencies
run: |
pip install -r requirements.txt -r requirements-dev.txt
- name: Build Executable
uses: Nuitka/Nuitka-Action@main
with:
nuitka-version: main
script-name: your_script.py
mode: app
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }} Build
path: |
build/*.exe
build/*.bin
build/*.app/**/*
build/*.dist/**/*
include-hidden-files: true