Skip to content

Python build

Python build #43

Workflow file for this run

name: Python build
on:
workflow_dispatch:
inputs:
target_os:
description: "Which OS do you want to build for?"
required: true
type: choice
options:
- windows
- mac
- linux
default: windows
jobs:
# -----------------------------------------------------
# Windows build
# -----------------------------------------------------
build-windows:
if: ${{ github.event.inputs.target_os == 'windows' }}
name: Build on Windows
runs-on: windows-latest
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13' ]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel build
python -m build
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
name: "elkai-windows-${{ matrix.python-version }}.whl"
path: dist/*.whl
# -----------------------------------------------------
# macOS build
# -----------------------------------------------------
build-macos:
if: ${{ github.event.inputs.target_os == 'mac' }}
name: Build on macOS
runs-on: macos-latest
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13' ]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel build
python -m build
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
name: "elkai-macos-${{ matrix.python-version }}.whl"
path: dist/*.whl
# -----------------------------------------------------
# Linux build (manylinux)
# -----------------------------------------------------
build-linux:
if: ${{ github.event.inputs.target_os == 'linux' }}
name: Build on Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Python wheels manylinux build
uses: pypa/[email protected]
env:
CIBW_ARCHS: auto64 # only 64-bit
CIBW_SKIP: "pp* *-musllinux_* cp36*" # no PyPy or cp36
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_BEFORE_BUILD: "python -m pip install build"
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
name: "elkai-manylinux"
path: wheelhouse/*.whl