Skip to content

Commit

Permalink
CI: Put release build conditional in the first job to avoid building …
Browse files Browse the repository at this point in the history
…every time
  • Loading branch information
greglucas committed Jul 2, 2024
1 parent caa0bef commit ffe0f9b
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 ffe0f9b

Please sign in to comment.