From fe537ee499e3d071cc0881771520cd8b95b48fbd Mon Sep 17 00:00:00 2001 From: Sandeep Kunkunuru Date: Thu, 23 Apr 2026 13:07:11 +0530 Subject: [PATCH] ci: build wheels for all supported Python versions and platforms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prior to this, `maturin-action` was invoked without an explicit interpreter list, so it only built one cp version per OS (cp312 on mac/win, cp38 on linux). Combined with `macos-latest` now being arm64-only, the v0.9.3 and v0.10.0 releases shipped just three wheels — leaving Intel-Mac and current-Python Linux users unable to install. - Add `macos-13` (Intel) alongside `macos-latest` (arm64). - Pass `-i python3.10 python3.11 python3.12 python3.13` so maturin builds wheels for every interpreter installed by `setup-python`. - Add a `build-sdist` job so platforms not covered by binary wheels can still fall back to a source build. After merging, tag a new release (e.g. v0.10.1) to re-publish with complete wheel coverage; the `optimization/` repo can then bump its pins to `>=0.9.3` without breaking developers on Intel Macs / Linux+cp312. --- .github/workflows/publish-python-package.yml | 40 +++++++++++++++++--- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-python-package.yml b/.github/workflows/publish-python-package.yml index 8987ff2..0d1dfa4 100644 --- a/.github/workflows/publish-python-package.yml +++ b/.github/workflows/publish-python-package.yml @@ -6,12 +6,15 @@ on: - 'v*' jobs: - build: + build-wheels: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + # macos-latest is arm64 on GitHub Actions now; macos-13 is the last Intel runner. + # Keep both so we ship wheels for Apple Silicon and Intel Macs. + os: [ubuntu-latest, macos-13, macos-latest, windows-latest] steps: - uses: actions/checkout@v4 @@ -29,11 +32,15 @@ jobs: 3.10 3.11 3.12 + 3.13 - name: Build wheels uses: PyO3/maturin-action@v1 with: - args: --release --out dist + # -i enumerates interpreters maturin should build for. Without this, + # maturin builds for whichever python3 happens to be on PATH (one + # cp version per OS) — the root cause of the 0.9.3 / 0.10.0 wheel gap. + args: --release --out dist -i python3.10 python3.11 python3.12 python3.13 sccache: 'true' manylinux: auto @@ -43,10 +50,28 @@ jobs: name: wheels-${{ matrix.os }} path: dist + build-sdist: + name: Build sdist + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Build sdist + uses: PyO3/maturin-action@v1 + with: + command: sdist + args: --out dist + - uses: actions/upload-artifact@v4 + with: + name: sdist + path: dist + release: name: Release runs-on: ubuntu-latest - needs: [build] + needs: [build-wheels, build-sdist] steps: - uses: actions/download-artifact@v4 with: @@ -54,10 +79,15 @@ jobs: path: dist merge-multiple: true + - uses: actions/download-artifact@v4 + with: + name: sdist + path: dist + - name: Publish to PyPI uses: PyO3/maturin-action@v1 with: command: upload args: --non-interactive --skip-existing dist/* env: - MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}