Skip to content

Build and Upload wheel #3

Build and Upload wheel

Build and Upload wheel #3

name: Build and Upload wheel
on:
workflow_dispatch:
release:
types: [published]
jobs:
build-wheel:
name: Build wheel
runs-on: ${{ matrix.platform[0] }}
strategy:
matrix:
platform:
- [ windows-latest, win_amd64]
- [ windows-latest, win32]
python: ["cp310", "cp311", "cp312", "cp313"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build wheels
uses: pypa/cibuildwheel@faf86a6ed7efa889faf6996aa23820831055001a # v2.23.3
env:
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform[1] }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.python }}-${{ matrix.platform[1] }}
path: ./wheelhouse/*.whl
pypi-publish:
name: Upload package to pypi
runs-on: ubuntu-latest
strategy:
matrix:
platform:
- [ windows-latest, win_amd64]
- [ windows-latest, win32]
python: ["cp310", "cp311", "cp312", "cp313"]
needs:
- build-wheel
permissions:
id-token: write
steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: ${{ matrix.python }}-${{ matrix.platform[1] }}
path: ./wheelhouse
- name: Publish release distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1.12
with:
verbose: true
packages-dir: ./wheelhouse/