Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

Workflow file for this run

# vim:ts=2:sw=2:et:ai:sts=2
name: 'Build and test wheels for release'
on:
release:
types: [created]
pull_request:
push:
branches:
- 'master'
- 'force_ci/all/**' # For development, forcing all workflows to run.
- 'force_ci/debian/**' # For debugging and/or only forcing this workflow.
jobs:
build_wheels:
name: 'Build and test wheels'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-11]
steps:
- uses: actions/checkout@v3
name: 'Checkout source repository'
with:
fetch-depth: 0
- name: Set up QEMU
if: runner.os == 'Linux' && github.event_name == 'release' && github.event.action == 'created'
uses: docker/setup-qemu-action@v2
with:
platforms: all
- uses: actions/setup-python@v4
name: 'Set up Python 3.11'
with:
python-version: '3.11'
- name: 'Install cibuildwheel'
run: |
python3 -m pip install cibuildwheel
- name: 'Build and test wheels'
env:
CIBW_ARCHS_MACOS: "x86_64 universal2 arm64"
CIBW_ARCHS_LINUX: auto aarch64
run: |
python3 -m cibuildwheel --output-dir dist
- uses: actions/upload-artifact@v2
name: 'Upload build artifacts'
if: github.event_name == 'release' && github.event.action == 'created'
with:
path: 'dist/*.whl'
build_sdist:
name: 'Build source distribution'
if: github.event_name == 'release' && github.event.action == 'created'
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v3
name: 'Checkout source repository'
with:
fetch-depth: 0
- uses: actions/setup-python@v4
name: 'Set up Python 3.10'
with:
python-version: '3.10'
- name: 'Build sdist'
run: >
pip3 install pkgconfig cython --upgrade &&
python3 setup.py sdist
- uses: actions/upload-artifact@v2
name: 'Upload build artifacts'
with:
path: 'dist/*.tar.gz'
upload_pypi:
name: 'Upload packages'
needs: ['build_wheels', 'build_sdist']
runs-on: 'ubuntu-latest'
if: github.event_name == 'release' && github.event.action == 'created'
steps:
- uses: actions/download-artifact@v2
name: 'Download artifacts'
with:
name: 'artifact'
path: 'dist'
- uses: pypa/gh-action-pypi-publish@release/v1
name: "Publish package to PyPI"
with:
user: '__token__'
password: '${{ secrets.PYPI_API_TOKEN }}'