Skip to content

Build Python wheels #18

Build Python wheels

Build Python wheels #18

Workflow file for this run

name: Build Python wheels
on:
workflow_dispatch:
inputs:
upload:
description: 'Upload wheels to PyPI? (0: no, 1: yes)'
required: true
default: '0'
jobs:
build_wheels:
strategy:
matrix:
os: [ubuntu-latest]
python: [none]
fail-fast: false
name: Create wheel
runs-on: ${{ matrix.os }}
steps:
- uses: Wandalen/wretry.action@v3.0.0
with:
action: actions/checkout@v4
with: |
submodules: recursive
attempt_limit: 3
attempt_delay: 2000
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.10'
- name: Install build dependencies with pinned setuptools
run: |
pip install --upgrade pip build "setuptools<77"
- name: Build wheel
run: |
python -m build --wheel --outdir wheelhouse
- uses: actions/upload-artifact@v4
with:
name: wheels-py3
path: ./wheelhouse/*.whl
upload_pypi:
name: Upload wheels to PyPI
runs-on: ubuntu-latest
if: ${{ github.event.inputs.upload == '1'}}
needs: [build_wheels]
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
merge-multiple: true
path: dist
- uses: pypa/gh-action-pypi-publish@v1.12.4
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}