From ffe0f9b3b78c15fc4581dbc067fd3ad9b8cf27bf Mon Sep 17 00:00:00 2001 From: Greg Lucas Date: Tue, 2 Jul 2024 07:59:58 -0600 Subject: [PATCH] CI: Put release build conditional in the first job to avoid building every time --- .github/workflows/release.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 63494c1bc..728434647 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,6 +20,17 @@ on: jobs: build_sdist: + if: | + github.event_name == 'release' || + (github.event_name == 'pull_request' && ( + ( + github.event.action == 'labeled' && + github.event.label.name == 'CI: build wheels' + ) || + contains(github.event.pull_request.labels.*.name, + 'CI: build wheels') + ) + ) name: Build source distribution runs-on: ubuntu-latest outputs: @@ -57,18 +68,8 @@ jobs: if-no-files-found: error generate-wheels-matrix: - if: | - github.event_name == 'release' || - (github.event_name == 'pull_request' && ( - ( - github.event.action == 'labeled' && - github.event.label.name == 'CI: build wheels' - ) || - contains(github.event.pull_request.labels.*.name, - 'CI: build wheels') - ) - ) name: Generate wheels matrix + needs: [build_sdist] runs-on: ubuntu-latest outputs: include: ${{ steps.set-matrix.outputs.include }}