diff --git a/.github/workflows/build_conda.yml b/.github/workflows/build_conda.yml index 43b33821..56dcdb55 100644 --- a/.github/workflows/build_conda.yml +++ b/.github/workflows/build_conda.yml @@ -11,6 +11,9 @@ on: jobs: build: + # The name leaves out the Python version so that the required status + # check on main keeps matching when the version is bumped + name: Conda build on ${{ matrix.platform }} strategy: fail-fast: false matrix: diff --git a/.github/workflows/build_wheel.yml b/.github/workflows/build_wheel.yml index 40d27e36..dc0f9ea3 100644 --- a/.github/workflows/build_wheel.yml +++ b/.github/workflows/build_wheel.yml @@ -23,6 +23,7 @@ jobs: # Job level so that the build and the statistics step talk to the same # sccache server configured for the GitHub Actions cache SCCACHE_GHA_ENABLED: "true" + CIBUILDWHEEL_VERSION: "4.3.0" steps: - uses: actions/checkout@v7 @@ -38,15 +39,24 @@ jobs: with: arch: x64 + # Pull requests and manual runs build only the newest Python that + # pyproject.toml lists for this platform; pushes to main and releases + # skip this step and build every version. Deriving the identifier here + # keeps pyproject.toml the single place where versions are added or + # dropped. + - name: Select the newest Python + if: ${{ !(github.event_name == 'release' || (github.event_name == 'push' && github.ref == 'refs/heads/main')) }} + shell: bash + run: | + newest=$(pipx run cibuildwheel==${{ env.CIBUILDWHEEL_VERSION }} --print-build-identifiers | sort -V | tail -n 1) + echo "Building $newest" + echo "CIBW_BUILD=$newest" >> "$GITHUB_ENV" + # Linux wheels build inside a manylinux container, which needs its own # sccache binary and the cache credentials the action exported; its # statistics are printed after each wheel since the host cannot see them. - name: Build wheels env: - # Pull requests and manual runs build only the newest Python; pushes - # to main and releases build every version listed in pyproject.toml - CIBW_SKIP: >- - ${{ !(github.event_name == 'release' || (github.event_name == 'push' && github.ref == 'refs/heads/main')) && 'cp312-* cp313-*' || '' }} CIBW_ENVIRONMENT_WINDOWS: CMAKE_GENERATOR=Ninja CIBW_REPAIR_WHEEL_COMMAND_LINUX: >- auditwheel repair -w {dest_dir} {wheel} && sccache --show-stats @@ -61,7 +71,7 @@ jobs: curl -sSL https://github.com/mozilla/sccache/releases/download/v0.18.0/sccache-v0.18.0-x86_64-unknown-linux-musl.tar.gz | tar -xz -C /usr/local/bin --strip-components=1 --wildcards '*/sccache' && chmod +x /usr/local/bin/sccache - run: pipx run cibuildwheel==4.3.0 + run: pipx run cibuildwheel==${{ env.CIBUILDWHEEL_VERSION }} - name: Compiler cache statistics if: runner.os != 'Linux' diff --git a/.github/workflows/build_with_docs.yml b/.github/workflows/build_with_docs.yml index 451d580e..c3523179 100644 --- a/.github/workflows/build_with_docs.yml +++ b/.github/workflows/build_with_docs.yml @@ -19,6 +19,9 @@ permissions: jobs: build: + # The name leaves out the Python version so that the required status + # check on main keeps matching when the version is bumped + name: CMake build on ${{ matrix.platform }} strategy: fail-fast: false matrix: