Update cibuildwheel to 2.20.0 to fix issue with CentOS mirrors being EOL #110
Workflow file for this run
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 and upload to PyPI | |
# taken from https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml | |
# Build on every branch push, tag push, and pull request change: | |
# on: [push, pull_request] | |
# Alternatively, to publish when a (published) GitHub Release is created, use the following: | |
on: | |
#push: | |
pull_request: | |
release: | |
types: | |
- published | |
concurrency: | |
# Cancel previous runs of this workflow for the same branch | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }}, arch ${{ matrix.arch }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
arch: x86_64 | |
- os: ubuntu-latest | |
arch: i686 | |
- os: ubuntu-latest | |
arch: aarch64 | |
- os: macos-13 | |
arch: x86_64 | |
- os: macos-latest | |
arch: arm64 | |
env: | |
CIBW_ARCHS: ${{ matrix.arch }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up QEMU | |
if: runner.os == 'Linux' && matrix.arch != 'x86_64' && matrix.arch != 'i686' | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: all | |
- name: Build wheels | |
uses: pypa/[email protected] | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibuildwheel-${{ matrix.os }}-${{ matrix.arch }} | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build sdist | |
run: pipx run build --sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibuildwheel-sdist | |
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.event.ref, 'refs/tags/v') | |
# alternatively, to publish when a GitHub Release is created, use the following rule: | |
if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: "cibuildwheel-*" | |
path: dist | |
merge-multiple: true | |
- uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
#repository_url: https://test.pypi.org/legacy/ | |
upload_release_assets: | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'release'}} | |
steps: | |
- name: Upload artifacts to release | |
uses: alexellis/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
asset_paths: '["./wheelhouse/*.whl"]' |