ci: add concurrency settings to wheels workflow #31
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 publish wheels | |
| on: | |
| push: | |
| workflow_dispatch: | |
| release: | |
| types: [published] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build_sdist: | |
| name: Build source distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.x" | |
| - name: Build sdist | |
| run: uv build --sdist | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: sdist | |
| path: dist/*.tar.gz | |
| build_wheels_windows: | |
| name: Build wheels on windows-latest | |
| runs-on: windows-latest | |
| needs: [build_sdist] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v3.4.0 | |
| env: | |
| CIBW_TEST_SKIP: "*" | |
| CIBW_ARCHS_WINDOWS: "AMD64 x86" | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: windows | |
| path: ./wheelhouse/*.whl | |
| retention-days: 1 | |
| build_wheels_windows_arm64: | |
| name: Build wheels on windows-11-arm | |
| runs-on: windows-11-arm | |
| needs: [build_sdist] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v3.4.0 | |
| env: | |
| CIBW_TEST_SKIP: "*" | |
| CIBW_ARCHS_WINDOWS: "ARM64" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-arm64 | |
| path: ./wheelhouse/*.whl | |
| retention-days: 1 | |
| build_wheels_macos: | |
| name: Build wheels on macos-latest | |
| runs-on: macos-latest | |
| needs: [build_sdist] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v3.4.0 | |
| env: | |
| CIBW_TEST_SKIP: "*" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos-latest | |
| path: ./wheelhouse/*.whl | |
| retention-days: 1 | |
| build_manylinux_wheels_ubuntu: | |
| name: Build manylinux wheels on ubuntu-latest | |
| runs-on: ubuntu-latest | |
| needs: [build_sdist] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v4 | |
| with: | |
| platforms: all | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v3.4.0 | |
| env: | |
| CIBW_TEST_SKIP: "*" | |
| CIBW_SKIP: "*-musllinux*" | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: manylinux | |
| path: ./wheelhouse/*.whl | |
| retention-days: 1 | |
| publish: | |
| if: github.event_name == 'release' | |
| name: Publish to PyPI | |
| needs: [build_sdist, build_wheels_windows, build_wheels_windows_arm64, build_wheels_macos, build_manylinux_wheels_ubuntu] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: Publish package distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| skip-existing: true |