From 9bc5bebdb3cccce43d80cdab67da1d69b6d6ee8b Mon Sep 17 00:00:00 2001 From: tonyhtchan Date: Sat, 1 Aug 2026 15:20:02 +0800 Subject: [PATCH] Publish wheels from every CI matrix OS, and publish an sdist The publish step was gated to matrix.os == 'ubuntu-latest', so the macOS/Windows wheels built by CI were never actually uploaded to PyPI -- only linux wheels reached PyPI for the 0.0.2 release. No sdist was ever built or published either. Restructures into three jobs: build_wheels (unchanged build logic, just per-OS artifact names so they don't collide), a new build_sdist job, and a new publish job that gathers every wheel artifact plus the sdist and uploads them all together. This also means pip can build from source on any platform lacking a prebuilt wheel, instead of falling back to the much older 0.0.1.post1 sdist that's still the last one published. --- .github/workflows/publish.yaml | 40 +++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index c22f39f..fb1780c 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -10,9 +10,6 @@ jobs: build_wheels: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} - environment: release - permissions: - id-token: write strategy: matrix: os: [ubuntu-latest, windows-latest, macos-13, macos-14] @@ -34,9 +31,42 @@ jobs: CIBW_SKIP: "*_i686 *-musllinux_*" - uses: actions/upload-artifact@v4 with: - name: lie_learn-${{ matrix.os }}-${{ strategy.job-index }} + name: wheels-${{ matrix.os }} path: ./dist/*.whl + build_sdist: + name: Build sdist + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + + - name: Build sdist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: sdist + path: ./dist/*.tar.gz + + publish: + name: Publish to PyPI + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + environment: release + permissions: + id-token: write + + steps: + - uses: actions/download-artifact@v4 + with: + pattern: wheels-* + path: dist + merge-multiple: true + - uses: actions/download-artifact@v4 + with: + name: sdist + path: dist + - name: Publish package - if: matrix.os == 'ubuntu-latest' uses: pypa/gh-action-pypi-publish@release/v1