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
# This is based on the cibuildwheel example at | |
# https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml | |
# | |
# This workflow builds and tests wheels across multiple platforms using | |
# cibuildwheel and creates the release sdist. Config not specified here can | |
# be found in pyproject.toml | |
name: Build and upload wheels | |
on: | |
push: | |
tags: | |
- '[0-9]+\.[0-9]+\.[0-9]+' | |
- '[0-9]+\.[0-9]+\.[0-9]+\.dev[0-9]+' | |
jobs: | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build sdist | |
run: pipx run build --sdist | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: dist/*.tar.gz | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-20.04 | |
cibw_archs: "native" | |
- os: ubuntu-20.04 | |
cibw_archs: "aarch64" | |
- os: windows-latest | |
cibw_archs: "native ARM64" | |
- os: macos-latest | |
cibw_archs: "x86_64 universal2 arm64" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up QEMU | |
if: matrix.cibw_archs == 'aarch64' | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: arm64 | |
- name: Build wheels | |
uses: pypa/cibuildwheel@v2.20.0 | |
env: | |
CIBW_TEST_REQUIRES: hypothesis pytest | |
CIBW_TEST_COMMAND: "py.test {project}/test.py -v && python {project}/cydoctest.py -v" | |
CIBW_SKIP: "pp* cp36-* cp37-*" | |
CIBW_ARCHS: ${{ matrix.cibw_archs }} | |
CIBW_TEST_SKIP: "*-win_arm64" | |
CIBW_BUILD_FRONTEND: "build" | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
upload_pypi: | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
# unpacks default artifact into dist/ | |
# if `name: artifact` is omitted, the action will create extra parent dir | |
name: artifact | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@v1.5.0 | |
# PRODUCTION PYPI: tags not containing dev. | |
# Note that the tags are already validated to control the running of | |
# this workflow! | |
if: "!contains(github.ref, 'dev')" | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
- uses: pypa/gh-action-pypi-publish@v1.5.0 | |
# Deploy tags containing 'dev' to test pypi. | |
# Note that the tags are already validated to control the running of | |
# this workflow! | |
if: contains(github.ref, 'dev') | |
with: | |
user: __token__ | |
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
repository_url: https://test.pypi.org/legacy/ |