1515
1616jobs :
1717 publish :
18- if : ${{ github.event.workflow_run.conclusion == 'success' }}
19-
2018 # Fine-grant permission
2119 # https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
2220 permissions :
@@ -25,13 +23,25 @@ jobs:
2523 id-token : write
2624 attestations : write
2725
28- runs-on : ubuntu-26.04
26+ runs-on : ubuntu-latest
2927
3028 outputs :
29+ should_release : ${{ steps.check.outputs.should_release }}
3130 tag_name : ${{ steps.tag.outputs.name }}
3231
3332 steps :
33+ - id : check
34+ env :
35+ COMMIT_MESSAGE : ${{ github.event.workflow_run.head_commit.message }}
36+ run : |
37+ if echo "$COMMIT_MESSAGE" | grep -q '\[no release\]'; then
38+ echo "should_release=false" >> $GITHUB_OUTPUT
39+ else
40+ echo "should_release=true" >> $GITHUB_OUTPUT
41+ fi
42+
3443 - name : Clone
44+ if : ${{ steps.check.outputs.should_release == 'true' }}
3545 id : checkout
3646 uses : actions/checkout@v6
3747 with :
@@ -40,10 +50,12 @@ jobs:
4050 ssh-key : ${{ secrets.DEPLOY_KEY_RELEASE }}
4151
4252 - name : Determine tag name
53+ if : ${{ steps.check.outputs.should_release == 'true' }}
4354 id : tag
4455 uses : ./.github/actions/get-tag-name
4556
4657 - name : Download artifacts
58+ if : ${{ steps.check.outputs.should_release == 'true' }}
4759 id : download-artifact
4860 uses : actions/download-artifact@v8
4961 with :
5466 skip-decompress : true
5567
5668 - name : Merge artifacts
69+ if : ${{ steps.check.outputs.should_release == 'true' }}
5770 id : move_artifacts
5871 run : |
5972 mkdir -p release
@@ -90,10 +103,12 @@ jobs:
90103 done
91104
92105 echo "Moving other artifacts..."
106+ rm -f artifact/llama-ui.zip
93107 mv -v artifact/*.zip release
94108 mv -v artifact/*.tar.gz release
95109
96110 - name : Download UI build
111+ if : ${{ steps.check.outputs.should_release == 'true' }}
97112 id : download_ui
98113 uses : actions/download-artifact@v8
99114 with :
@@ -103,17 +118,20 @@ jobs:
103118 github-token : ${{ github.token }}
104119
105120 - name : Package UI
121+ if : ${{ steps.check.outputs.should_release == 'true' }}
106122 id : package_ui
107123 run : |
108124 tar -czvf release/llama-${{ steps.tag.outputs.name }}-ui.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C ./ui-dist .
109125
110126 - name : Attest release artifacts
127+ if : ${{ steps.check.outputs.should_release == 'true' }}
111128 id : attest
112129 uses : actions/attest@v4
113130 with :
114131 subject-path : ' release/*'
115132
116133 - name : Create release
134+ if : ${{ steps.check.outputs.should_release == 'true' }}
117135 id : create_release
118136 uses : ggml-org/action-create-release@v1
119137 env :
@@ -183,6 +201,7 @@ jobs:
183201 - [UI](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-ui.tar.gz)
184202
185203 - name : Upload release
204+ if : ${{ steps.check.outputs.should_release == 'true' }}
186205 id : upload_release
187206 uses : actions/github-script@v8
188207 with :
@@ -205,7 +224,7 @@ jobs:
205224 }
206225
207226 ui-publish :
208- if : ${{ github.event.workflow_run.conclusion == 'success ' }}
227+ if : ${{ needs.publish.outputs.should_release == 'true ' }}
209228
210229 needs :
211230 - publish
0 commit comments