Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cibuildwheel in build chains to actually build 3.10 and 3.11 wheels #6

Merged
merged 10 commits into from
Nov 28, 2022
66 changes: 66 additions & 0 deletions .github/workflows/build-and-upload-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build and upload to PyPI

on:
release:
types:
- published

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# Windows builds currently broken
#os: [ubuntu-20.04, windows-2019, macos-11]
os: [ubuntu-20.04, macos-11]

steps:
- uses: actions/checkout@v3

- name: Checkout submodules
shell: bash
run: |
git submodule sync --recursive
git submodule update --init --force --recursive --depth=1

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_MANYLINUX_X86_64_IMAGE: 'manylinux2014'
CIBW_ARCHS: auto64
CIBW_BUILD: 'cp3*'
CIBW_SKIP: '*-musllinux_*'

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

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

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
162 changes: 0 additions & 162 deletions .github/workflows/build-linux.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build for macOS
name: Test for macOS

on:
- push
Expand Down Expand Up @@ -37,14 +37,9 @@ jobs:
with:
python-version: "3.7"

- uses: actions/setup-python@v4
name: Install Python 3.6
with:
python-version: "3.6"

- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==1.6.3
python -m pip install cibuildwheel==2.11.2

- name: Checkout submodules
shell: bash
Expand Down Expand Up @@ -76,38 +71,8 @@ jobs:
run: |
tox -e py37

- name: Test for Python 3.6
run: |
tox -e py36

- name: Build wheel
if: contains(github.ref, 'tags/')
run: |
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: cp36-* cp37-* cp38-* cp39-* cp310-* cp311-*

- uses: actions/upload-artifact@v1
if: contains(github.ref, 'tags/')
with:
name: wheels
path: ./wheelhouse

upload_pypi:
name: 'Upload packages'
needs: ['build_wheels']
runs-on: 'ubuntu-latest'
if: contains(github.ref, 'tags/')
steps:
- uses: actions/download-artifact@v3
name: 'Download artifacts'
with:
name: wheels
path: ./wheelhouse

- uses: pypa/gh-action-pypi-publish@release/v1
name: "Publish package to PyPI"
with:
user: '__token__'
password: '${{ secrets.PYPI_API_TOKEN }}'
packages_dir: ./wheelhouse
CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-*
78 changes: 78 additions & 0 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Test for Linux

on:
- push
- pull_request

jobs:
build_wheels:
name: Build wheel on Linux
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
name: Install Python 3.11
with:
python-version: "3.11"

- uses: actions/setup-python@v4
name: Install Python 3.10
with:
python-version: "3.10"

- uses: actions/setup-python@v4
name: Install Python 3.9
with:
python-version: "3.9"

- uses: actions/setup-python@v4
name: Install Python 3.8
with:
python-version: "3.8"

- uses: actions/setup-python@v4
name: Install Python 3.7
with:
python-version: "3.7"

- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.11.2

- name: Checkout submodules
shell: bash
run: |
git submodule sync --recursive
git submodule update --init --force --recursive --depth=1

- name: Install dependencies
run: |
pip install -r requirements-dev.txt

- name: Test for Python 3.11
run: |
tox -e py311

- name: Test for Python 3.10
run: |
tox -e py310

- name: Test for Python 3.9
run: |
tox -e py39

- name: Test for Python 3.8
run: |
tox -e py38

- name: Test for Python 3.7
run: |
tox -e py37

- name: Build wheel
run: |
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-*
Loading