Skip to content

Python wheels

Python wheels #753

Workflow file for this run

name: Python wheels
on:
schedule:
- cron: '0 3 * * *'
release:
workflow_dispatch:
inputs:
publish:
description: force publish to pypi
type: boolean
pypi_version_override:
description: override version id detection
type: string
env:
CARGO_INCREMENTAL: false
PYPI_VERSION_OVERRIDE: ${{ inputs.pypi_version_override }}
CIBW_ENVIRONMENT_PASS_LINUX: "PYPI_VERSION_OVERRIDE"
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
steps:
- uses: actions/checkout@v3
- name: Setup | Rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: stable
- uses: actions/setup-python@v3
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheels
uses: nick-fields/retry@v2
with:
max_attempts: 3
timeout_seconds: 36000 # 10 hours :/
command: python -m cibuildwheel --output-dir wheelhouse api/py
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build SDist
run: cd api/py ; pipx run build --sdist
- uses: actions/upload-artifact@v3
with:
path: api/py/dist/*.tar.gz
upload_all:
needs: [build_wheels, make_sdist]
runs-on: ubuntu-latest
if: (github.event_name == 'release' && github.event.action == 'published') || inputs.publish
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@v1.5.1
with:
user: __token__
password: ${{ secrets.PYPI }}
verbose: true