Skip to content

Build and deploy wheels #51

Build and deploy wheels

Build and deploy wheels #51

Workflow file for this run

name: Build and deploy wheels
on:
push:
tags:
- v*
workflow_dispatch:
inputs:
os_choice:
description: 'Choose the OS to build for'
required: true
default: 'all'
type: choice
options:
- all
- ubuntu-latest
- windows-latest
- macos-latest
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
if: ${{ github.event_name == 'push' || github.event.inputs.os_choice == 'all' || github.event.inputs.os_choice == matrix.os }}

Check failure on line 30 in .github/workflows/wheels-deploy.yml

View workflow run for this annotation

GitHub Actions / Build and deploy wheels

Invalid workflow file

The workflow is not valid. .github/workflows/wheels-deploy.yml (Line: 30, Col: 9): Unrecognized named-value: 'matrix'. Located at position 107 within expression: github.event_name == 'push' || github.event.inputs.os_choice == 'all' || github.event.inputs.os_choice == matrix.os
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Build wheels
uses: pypa/[email protected]
with:
output-dir: ./wheelhouse
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl
overwrite: true
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' || github.event.inputs.os_choice == 'all' || github.event.inputs.os_choice == 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
overwrite: true
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
name: wheels-ubuntu-latest
path: dist/
- uses: actions/download-artifact@v4
with:
name: wheels-macos-latest
path: dist/
- uses: actions/download-artifact@v4
with:
name: wheels-windows-latest
path: dist/
- uses: actions/download-artifact@v4
with:
name: sdist
path: dist/
- name: List artifacts (debug)
run: ls dist
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}