Include Python 3.11 and 3.12 to tests and wheels. #66
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
name: Build | |
on: [push, pull_request] | |
jobs: | |
build_wheels: | |
name: Build wheel for ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }} ${{ matrix.buildplat[2] }} | |
runs-on: ${{ matrix.buildplat[0] }} | |
strategy: | |
fail-fast: false | |
matrix: | |
# similar to scipy wheels, see github action | |
# https://github.com/scipy/scipy/blob/ece78377d322f891b1ca2d248ac82caa3411837e/.github/workflows/wheels.yml | |
buildplat: | |
- [ubuntu-20.04, manylinux, x86_64] | |
# - [ubuntu-20.04, manylinux, aarch64] | |
- [macos-11, macosx, x86_64] | |
- [macos-12, macosx, arm64] | |
- [windows-2019, win, AMD64] | |
python: | |
- ["cp38", "3.8"] | |
- ["cp39", "3.9"] | |
- ["cp310", "3.10"] | |
- ["cp311", "3.11"] | |
- ["cp312", "3.12"] | |
steps: | |
- uses: actions/checkout@v3 | |
# Used to host cibuildwheel | |
- uses: actions/setup-python@v3 | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel==2.10.1 | |
# https://github.com/scipy/oldest-supported-numpy/blob/master/setup.cfg | |
- name: Build wheels | |
run: | | |
python -m cibuildwheel --output-dir wheelhouse | |
env: | |
CIBW_BEFORE_BUILD: pip install oldest-supported-numpy | |
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}* | |
CIBW_ARCHS: ${{ matrix.buildplat[2] }} | |
CIBW_TEST_REQUIRES: packaging | |
# no scipy wheels available for 3.11, | |
# skip warning for Apple Silicon tests | |
CIBW_TEST_SKIP: "cp311-* *aarch64 *-macosx_arm64" | |
CIBW_TEST_COMMAND: python {package}/tests/test_deform_grid.py -v | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
name: Install Python | |
with: | |
python-version: '3.8' | |
- name: Build sdist | |
run: python setup.py sdist | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: dist/*.tar.gz | |
upload_pypi: | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
# upload to PyPI on every tag starting with 'v' | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_password }} | |
create_github_release: | |
runs-on: ubuntu-latest | |
# create a draft release on every tag starting with 'v' | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
body: Updated version. | |
draft: true | |
prerelease: false | |
files: dist/*.tar.gz |