Skip to content

Bump pypa/cibuildwheel from 2.20.0 to 2.21.0 (#125) #419

Bump pypa/cibuildwheel from 2.20.0 to 2.21.0 (#125)

Bump pypa/cibuildwheel from 2.20.0 to 2.21.0 (#125) #419

name: Tests and build wheels
on: [push, pull_request]
jobs:
ci:
name: Tests ${{ matrix.os }} ${{ matrix.python-architecture }} - Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13-dev' ]
python-architecture: [ '' ]
include:
- os: windows-latest
python-architecture: 'x86'
python-version: '3.8'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.python-architecture }}
- name: Build module and run pytest
run: |
pip install wheel setuptools
pip install -r tests/requirements.txt
pip install . -v
python -c "import sabctools; print('Version:', sabctools.__version__);"
python -c "import sabctools; print('SIMD:', sabctools.simd);"
python -c "import sabctools; print('OpenSSL linked:', sabctools.openssl_linked);"
pytest
build_wheels:
name: Build wheels on ${{ matrix.os }} ${{ matrix.linux_arch }}
needs: ci
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
- os: macos-latest
- os: ubuntu-latest
linux_arch: x86_64
- os: ubuntu-latest
linux_arch: aarch64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.11'
- name: Set up QEMU
if: runner.os == 'Linux' && matrix.linux_arch == 'aarch64'
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Build wheels
uses: pypa/cibuildwheel@v2.21.0
env:
CIBW_SKIP: pp* *i686* cp36* cp37*
CIBW_ARCHS_LINUX: ${{ matrix.linux_arch }}
CIBW_ARCHS_MACOS: universal2
CIBW_ARCHS_WINDOWS: all
CIBW_BUILD_VERBOSITY: 1
CIBW_TEST_SKIP: '*'
- name: Upload wheel artifacts
uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: Wheels ${{ matrix.os }} ${{ matrix.linux_arch }}
# The action/upload-artifact only allows unique filenames for whole run
- name: Build source distribution
run: python setup.py sdist
- name: Upload source distribution artifact
uses: actions/upload-artifact@v4
if: runner.os == 'Linux' && matrix.linux_arch == 'aarch64'
with:
path: ./dist/*.tar.gz
name: Source distribution
- name: Publish to PyPI
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: ${{ secrets.PYPI_API_KEY }}
if: env.TWINE_PASSWORD && startsWith(github.ref, 'refs/tags/')
run: |
pip install twine
twine upload --skip-existing ./dist/*.tar.gz ./wheelhouse/*.whl
- name: Publish release to GitHub
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/') && runner.os == 'Linux' && matrix.linux_arch == 'aarch64'
with:
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: false
files: ./dist/*.tar.gz