Skip to content

Update workflows to build Python 3.11 wheels, and drop Python 3.7 support #116

Update workflows to build Python 3.11 wheels, and drop Python 3.7 support

Update workflows to build Python 3.11 wheels, and drop Python 3.7 support #116

Workflow file for this run

# This workflow will build and (if release) publish Python distributions to PyPI
# For more information see:
# - https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
# - https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
#
name: build-publish
on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [published]
jobs:
build-wheels:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
python: 38
platform: manylinux_x86_64
- os: ubuntu-latest
python: 39
platform: manylinux_x86_64
- os: ubuntu-latest
python: 310
platform: manylinux_x86_64
- os: ubuntu-latest
python: 311
platform: manylinux_x86_64
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform }}
CIBW_ARCHS: all
CIBW_BUILD_VERBOSITY: 1
- name: Store wheels
uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
build-src:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build src
run: |
python -m pip install --upgrade pip
pip install wheel
python setup.py sdist
- name: Store src
uses: actions/upload-artifact@v2
with:
path: dist/*.tar.gz
build-wheels-ms:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11' ]
include:
- os: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Add MSBuild to PATH
uses: microsoft/[email protected]
- name: Build wheel
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
pip install wheel cmake-build-extension
pip wheel . --no-deps -w wheelhouse/
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
publish:
runs-on: ubuntu-latest
needs:
- build-wheels
- build-wheels-ms
- build-src
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Download dists
uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}