From 037effa0d7093ddacd1e8afe869e13b3d098aff7 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 7 Oct 2024 18:58:56 -0400 Subject: [PATCH] c: Fix pin for cibuildwheel when building matrix We used to install cibuildwheel manually in order to generate the Python-version matrix. This means that dependabot does not notice or update it. This is normally fine, but when cibuildwheel adds new Python versions, they won't be in the generated matrix until the pin is updated. Instead of the manual install, use the action to install cibuildwheel, but don't have it run anything. --- .github/workflows/release.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 983c0c24e..495092957 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,3 +1,4 @@ +--- name: Build and upload to PyPI concurrency: @@ -75,19 +76,22 @@ jobs: include: ${{ steps.set-matrix.outputs.include }} steps: - uses: actions/checkout@v4 - - name: Install cibuildwheel - run: pipx install cibuildwheel==2.16.2 + - uses: pypa/cibuildwheel@f1859528322d7b29d4493ee241a167807661dfb4 # v2.21.2 + with: + # We only use this action to install cibuildwheel with a pin that + # dependabot can see and update, so don't actually run cibuildwheel. + package-dir: --help - id: set-matrix run: | MATRIX=$( { cibuildwheel --print-build-identifiers --platform linux \ - | jq -nRc '{"only": inputs, "os": "ubuntu-latest"}' \ + | jq --null-input --raw-input --compact-output '{"only": inputs, "os": "ubuntu-latest"}' \ && cibuildwheel --print-build-identifiers --platform macos \ - | jq -nRc '{"only": inputs, "os": "macos-latest"}' \ + | jq --null-input --raw-input --compact-output '{"only": inputs, "os": "macos-latest"}' \ && cibuildwheel --print-build-identifiers --platform windows \ - | jq -nRc '{"only": inputs, "os": "windows-2019"}' - } | jq -sc + | jq --null-input --raw-input --compact-output '{"only": inputs, "os": "windows-2019"}' + } | jq --slurp --compact-output ) echo "include=$MATRIX" >> $GITHUB_OUTPUT env: