Skip to content

Commit 08bc21b

Browse files
authored
ci : move [no release] check to dedicated check_release job (ggml-org#23734)
* ci : move [no release] check to dedicated check_release job Move the workflow-level \`if\` condition that skips builds when the commit message contains \`[no release]\` into a lightweight \`check_release\` job. All build jobs now depend on it via \`needs\` and check its output. This ensures the skip logic is evaluated at the job level rather than at the workflow level, which is the recommended approach for conditional jobs. Assisted-by: llama.cpp:local pi * cont : use `fast` runner
1 parent 35a74c8 commit 08bc21b

1 file changed

Lines changed: 45 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
name: Release
22

3-
# Skip this workflow on push to master if the commit message contains [no release]
4-
if: |
5-
github.event_name != 'push' ||
6-
github.ref != 'refs/heads/master' ||
7-
!contains(github.event.head_commit.message, '[no release]')
8-
93
on:
104
workflow_dispatch: # allows manual triggering
115
inputs:
@@ -43,7 +37,30 @@ env:
4337

4438
jobs:
4539

40+
check_release:
41+
runs-on: [self-hosted, fast]
42+
43+
outputs:
44+
should_release: ${{ steps.check.outputs.should_release }}
45+
46+
steps:
47+
- id: check
48+
run: |
49+
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
50+
echo "should_release=true" >> $GITHUB_OUTPUT
51+
elif [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/master" ]]; then
52+
if echo "${{ github.event.head_commit.message }}" | grep -q '\[no release\]'; then
53+
echo "should_release=false" >> $GITHUB_OUTPUT
54+
else
55+
echo "should_release=true" >> $GITHUB_OUTPUT
56+
fi
57+
else
58+
echo "should_release=false" >> $GITHUB_OUTPUT
59+
fi
60+
4661
macos-cpu:
62+
needs: [check_release]
63+
if: ${{ needs.check_release.outputs.should_release == 'true' }}
4764
strategy:
4865
matrix:
4966
include:
@@ -114,6 +131,8 @@ jobs:
114131
name: llama-bin-macos-${{ matrix.build }}.tar.gz
115132

116133
ubuntu-cpu:
134+
needs: [check_release]
135+
if: ${{ needs.check_release.outputs.should_release == 'true' }}
117136
strategy:
118137
matrix:
119138
include:
@@ -190,6 +209,8 @@ jobs:
190209
name: llama-bin-ubuntu-${{ matrix.build }}.tar.gz
191210

192211
ubuntu-vulkan:
212+
needs: [check_release]
213+
if: ${{ needs.check_release.outputs.should_release == 'true' }}
193214

194215
strategy:
195216
matrix:
@@ -266,6 +287,8 @@ jobs:
266287
name: llama-bin-ubuntu-vulkan-${{ matrix.build }}.tar.gz
267288

268289
android-arm64:
290+
needs: [check_release]
291+
if: ${{ needs.check_release.outputs.should_release == 'true' }}
269292

270293
runs-on: ubuntu-latest
271294

@@ -343,6 +366,8 @@ jobs:
343366
name: llama-bin-android-arm64.tar.gz
344367

345368
ubuntu-24-openvino:
369+
needs: [check_release]
370+
if: ${{ needs.check_release.outputs.should_release == 'true' }}
346371

347372
runs-on: ubuntu-24.04
348373

@@ -431,6 +456,8 @@ jobs:
431456
name: llama-bin-ubuntu-openvino-${{ env.OPENVINO_VERSION_MAJOR }}-x64.tar.gz
432457

433458
windows-cpu:
459+
needs: [check_release]
460+
if: ${{ needs.check_release.outputs.should_release == 'true' }}
434461

435462
runs-on: windows-2025
436463

@@ -491,6 +518,8 @@ jobs:
491518
name: llama-bin-win-cpu-${{ matrix.arch }}.zip
492519

493520
windows:
521+
needs: [check_release]
522+
if: ${{ needs.check_release.outputs.should_release == 'true' }}
494523

495524
runs-on: windows-2025
496525

@@ -581,6 +610,8 @@ jobs:
581610
name: llama-bin-win-${{ matrix.backend }}-${{ matrix.arch }}.zip
582611

583612
windows-cuda:
613+
needs: [check_release]
614+
if: ${{ needs.check_release.outputs.should_release == 'true' }}
584615

585616
runs-on: windows-2022
586617

@@ -869,6 +900,8 @@ jobs:
869900
# name: llama-bin-ubuntu-sycl-${{ matrix.build }}-x64.tar.gz
870901

871902
ubuntu-22-rocm:
903+
needs: [check_release]
904+
if: ${{ needs.check_release.outputs.should_release == 'true' }}
872905

873906
runs-on: ubuntu-22.04
874907

@@ -980,6 +1013,8 @@ jobs:
9801013
name: llama-bin-ubuntu-rocm-${{ env.ROCM_VERSION_SHORT }}-${{ matrix.build }}.tar.gz
9811014

9821015
windows-hip:
1016+
needs: [check_release]
1017+
if: ${{ needs.check_release.outputs.should_release == 'true' }}
9831018

9841019
runs-on: windows-2022
9851020

@@ -1094,6 +1129,8 @@ jobs:
10941129
name: llama-bin-win-hip-${{ matrix.name }}-x64.zip
10951130

10961131
ios-xcode-build:
1132+
needs: [check_release]
1133+
if: ${{ needs.check_release.outputs.should_release == 'true' }}
10971134
runs-on: macos-15
10981135

10991136
steps:
@@ -1242,6 +1279,8 @@ jobs:
12421279
# name: llama-bin-${{ matrix.chip_type }}-openEuler-${{ matrix.arch }}${{ matrix.use_acl_graph == 'on' && '-aclgraph' || '' }}.tar.gz
12431280

12441281
ui-build:
1282+
needs: [check_release]
1283+
if: ${{ needs.check_release.outputs.should_release == 'true' }}
12451284
uses: ./.github/workflows/ui-build.yml
12461285

12471286
release:

0 commit comments

Comments
 (0)