Skip to content

Commit

Permalink
Disable all steps in job when not building wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
mwilliamson committed Jun 14, 2024
1 parent 34434a8 commit 0936bef
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,48 +119,52 @@ jobs:

steps:

- name: Check whether to build wheel
id: should-build-wheel
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'
run: echo true=1 >> $GITHUB_OUTPUT

- uses: actions/checkout@v4
if: steps.should-build-wheel.outputs.true

- name: Use Python 3.11
if: steps.should-build-wheel.outputs.true
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Set up MSYS2
if: runner.os == 'Windows'
if: steps.should-build-wheel.outputs.true && runner.os == 'Windows'
uses: ./.github/actions/setup-msys2
with:
arch: ${{ matrix.arch }}

- name: Set up QEMU
if: runner.os == 'Linux'
if: steps.should-build-wheel.outputs.true && runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Print build identifiers
if: steps.should-build-wheel.outputs.true
run: |
python -m pip install cibuildwheel==2.17.0
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'
if: steps.should-build-wheel.outputs.true
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'
if: steps.should-build-wheel.outputs.true
with:
path: ./wheelhouse/*.whl

Expand Down

0 comments on commit 0936bef

Please sign in to comment.