Add Linux arm64 support and require Python 3.10+ #123
Workflow file for this run
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
| # based on https://github.com/joerick/cibuildwheel/blob/master/examples/github-minimal.yml | |
| name: Build wheels | |
| on: | |
| push: | |
| branches: [master] | |
| # Sequence of patterns matched against refs/tags | |
| tags: | |
| - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| build_wheels: | |
| name: Build wheels on ${{ matrix.os }} | |
| if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # unshallow fetch for setuptools-scm | |
| submodules: recursive | |
| - name: Append Git to the path | |
| run: echo "C:\Program Files\Git\mingw64\libexec\git-core" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| if: matrix.os == 'windows-latest' | |
| - uses: actions/setup-python@v5 | |
| name: Install Python | |
| with: | |
| python-version: '3.10' | |
| - name: Install cibuildwheel | |
| run: | | |
| python -m pip install cibuildwheel | |
| - name: Build wheel | |
| run: | | |
| python -m cibuildwheel --output-dir dist | |
| env: | |
| # avoid timeout when cloning | |
| CIBW_BEFORE_ALL: | | |
| git config --global url.https://github.com/.insteadOf git://github.com/ | |
| # prepare build dependencies | |
| CIBW_BEFORE_ALL_LINUX: | | |
| git config --global url.https://github.com/.insteadOf git://github.com/ | |
| dnf install -y libuuid-devel | |
| # make sure afdko submodule is not "dirty" before starting a new build | |
| CIBW_BEFORE_BUILD: "git submodule foreach git clean -fdx" | |
| # The embedded 'tx' C executable is independent of Python ABI, but we build | |
| # and test for all supported Python versions (3.10+). | |
| CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-*" | |
| # build using the manylinux_2_28 image | |
| CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 | |
| CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28 | |
| # Only build Universal2 on Mac | |
| CIBW_ARCHS_MACOS: universal2 | |
| CIBW_ENVIRONMENT_MACOS: "CFLAGS='-arch arm64 -arch x86_64' CXXFLAGS='-arch arm64 -arch x86_64' LDFLAGS='-arch arm64 -arch x86_64'" | |
| # skip PyPy, 32-bit linux, musl linux, and unsupported architectures | |
| CIBW_SKIP: "pp* cp*manylinux_i686 cp*manylinux_ppc64le cp*manylinux_s390x *-musllinux*" | |
| # Force static link of libxml2 | |
| CIBW_ENVIRONMENT: "FORCE_BUILD_LIBXML2=ON" | |
| CIBW_TEST_REQUIRES: "pytest" | |
| # run test suite with pytest, no coverage | |
| # TODO: run with coverage and publish to codecov.io | |
| CIBW_TEST_COMMAND: "pytest {project}/tests" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: cffsubr-dist-${{ matrix.os }} | |
| path: ./dist | |
| publish: | |
| name: Publish to PyPI | |
| needs: build_wheels | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # unshallow fetch for setuptools-scm | |
| submodules: recursive | |
| - uses: actions/setup-python@v5 | |
| name: Install Python | |
| with: | |
| python-version: '3.10' | |
| - name: Build sdist | |
| run: pipx run build --sdist | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: cffsubr-dist-* | |
| merge-multiple: true | |
| path: ./dist | |
| - name: Publish package to PyPI | |
| run: | | |
| pip install twine | |
| twine upload dist/* | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.pypi_password }} |