Python wheels #434
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python wheels | |
on: | |
schedule: | |
- cron: '0 3 * * *' | |
release: | |
workflow_dispatch: | |
inputs: | |
publish: | |
description: force publish to pypi | |
type: boolean | |
env: | |
CARGO_INCREMENTAL: false | |
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/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI }} | |
verbose: true |