Build manylinux/musllinux aarch64 wheels #6
This file contains hidden or 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 | |
| # 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 | |
| env: | |
| CIBW_BUILD_VERBOSITY: 3 | |
| CIBW_TEST_COMMAND: python -m unittest discover {project}/tests | |
| # Disable building PyPy wheels on all platforms | |
| CIBW_SKIP: pp* | |
| # The windows builds was reusing the found win32 dll instead of downloading the win64 one. | |
| # Additionally, the build directory contained the prior win32 dll. Easier to delete it, too. | |
| CIBW_BEFORE_BUILD_WINDOWS: del /q {project}\parasail\parasail.dll | |
| # automake is not included in the stock macos runner, which triggers `setup.py` to install all deps (not just | |
| # the missing ones). However, the newly installed m4 binary fails on macos with a SIGABRT (though the original | |
| # `brew` installed one does not) as documented in: | |
| # https://github.com/jeffdaily/parasail-python/issues/24. | |
| CIBW_BEFORE_BUILD_MACOS: brew install automake | |
| jobs: | |
| build_wheels: | |
| name: Build wheels for ${{ matrix.python }}-${{ matrix.buildplat[1] }} | |
| runs-on: ${{ matrix.buildplat[0] }} | |
| strategy: | |
| # Ensure that a wheel builder finishes even if another fails | |
| fail-fast: false | |
| matrix: | |
| buildplat: | |
| - [ubuntu-latest, manylinux_x86_64, auto] | |
| - [ubuntu-latest, musllinux_i686, auto] | |
| # No floating "ubuntu-latest-arm" alias exists (yet) for GitHub's native arm64 | |
| # runners, only version-pinned images: | |
| # https://github.blog/changelog/2024-06-24-github-actions-ubuntu-24-04-image-now-available-for-arm64-runners/ | |
| - [ubuntu-24.04-arm, manylinux_aarch64, auto] | |
| - [ubuntu-24.04-arm, musllinux_aarch64, auto] | |
| - [windows-latest, win_amd64, auto] | |
| - [windows-latest, win32, auto] | |
| - [macos-latest, macosx_x86_64, x86_64] | |
| - [macos-latest, macosx_arm64, arm64] | |
| # we only need to build for a single python version since the wheels are universal | |
| python: ["cp310"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v2.20.0 | |
| env: | |
| CIBW_ARCHS: ${{ matrix.buildplat[2] }} | |
| CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-${{ matrix.buildplat[1] }} | |
| 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: 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.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: | |
| # v4 requires unique names per upload (unlike v3, which merged same-named | |
| # artifacts), so build_wheels/build_sdist upload under distinct names and | |
| # this flattens them all into dist/ | |
| path: dist | |
| pattern: "*" | |
| merge-multiple: true | |
| - uses: pypa/gh-action-pypi-publish@v1.5.0 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.pypi_password }} | |
| # To test: repository_url: https://test.pypi.org/legacy/ |