Skip to content

Commit

Permalink
Merge pull request #2409 from greglucas/ci-release-conditional
Browse files Browse the repository at this point in the history
CI: Put release build conditional in the first job to avoid building every time
  • Loading branch information
dopplershift authored Jul 8, 2024
2 parents e127aea + ffe0f9b commit 009196f
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}
Expand Down

0 comments on commit 009196f

Please sign in to comment.