Skip to content

Commit

Permalink
Filter building of wheels at the job level
Browse files Browse the repository at this point in the history
  • Loading branch information
mwilliamson committed Jun 14, 2024
1 parent 34434a8 commit a8d93a3
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ jobs:
strategy:
matrix: ${{ fromJson(needs.build_wheels_matrix.outputs.matrix) }}

if: |
(github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')) ||
matrix.cibw-only == 'cp310-manylinux_x86_64' ||
matrix.cibw-only == 'cp310-win_amd64' ||
matrix.cibw-only == 'cp310-win32'
runs-on: ${{ matrix.os }}

steps:
Expand Down Expand Up @@ -144,23 +150,13 @@ jobs:
python -m cibuildwheel --only ${{ matrix.cibw-only }} --print-build-identifiers
- name: Build wheels
if: |
(github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')) ||
matrix.cibw-only == 'cp310-manylinux_x86_64' ||
matrix.cibw-only == 'cp310-win_amd64' ||
matrix.cibw-only == 'cp310-win32'
uses: pypa/[email protected]
with:
only: ${{ matrix.cibw-only }}
env:
CIBW_ENVIRONMENT: ${{ runner.os == 'Windows' && matrix.arch == 'x86' && 'CC=i686-w64-mingw32-gcc.exe' || '' }}

- uses: actions/upload-artifact@v3
if: |
(github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')) ||
matrix.cibw-only == 'cp310-manylinux_x86_64' ||
matrix.cibw-only == 'cp310-win_amd64' ||
matrix.cibw-only == 'cp310-win32'
with:
path: ./wheelhouse/*.whl

Expand Down

0 comments on commit a8d93a3

Please sign in to comment.