name: Release on: workflow_dispatch: release: types: - published permissions: {} jobs: build_wheels: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} needs: build_sdist strategy: matrix: os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest] steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # was: actions/checkout@v6 - name: Build wheels uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # was: pypa/cibuildwheel@v3.4.1 - name: Upload uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # was: actions/upload-artifact@v7 with: name: cibw-wheels-${{ matrix.os }} path: ./wheelhouse/*.whl build_sdist: name: Build source distribution runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # was: actions/checkout@v6 - name: Build SDist run: pipx run build --sdist - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # was: actions/upload-artifact@v7 with: name: cibw-sdist path: dist/*.tar.gz upload_pypi: needs: [build_wheels, build_sdist] runs-on: ubuntu-latest environment: pypi permissions: id-token: write # Comment this line for testing if: github.event_name == 'release' && github.event.action == 'published' steps: - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c with: # unpacks all CIBW artifacts into dist/ pattern: cibw-* path: dist merge-multiple: true - uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # To test uploads to TestPyPI, uncomment the following: # with: # repository-url: https://test.pypi.org/legacy/