Skip to content

Commit 86f85ae

Browse files
authored
test
1 parent 81bc6b8 commit 86f85ae

3 files changed

Lines changed: 334 additions & 1668 deletions

File tree

Lines changed: 226 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,226 @@
1+
name: Publish Release
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- Release
7+
types:
8+
- completed
9+
branches:
10+
- master
11+
12+
env:
13+
GH_TOKEN: ${{ github.token }}
14+
BRANCH_NAME: master
15+
16+
jobs:
17+
publish:
18+
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.jobs.check-release.outputs.should_release == 'true' }}
19+
20+
# Fine-grant permission
21+
# https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
22+
permissions:
23+
actions: read
24+
contents: write # for creating release
25+
id-token: write
26+
attestations: write
27+
28+
runs-on: ubuntu-26.04
29+
30+
outputs:
31+
tag_name: ${{ steps.tag.outputs.name }}
32+
33+
steps:
34+
- name: Clone
35+
id: checkout
36+
uses: actions/checkout@v6
37+
with:
38+
ref: ${{ github.event.workflow_run.head_sha }}
39+
fetch-depth: 0
40+
ssh-key: ${{ secrets.DEPLOY_KEY_RELEASE }}
41+
42+
- name: Determine tag name
43+
id: tag
44+
uses: ./.github/actions/get-tag-name
45+
46+
- name: Download artifacts
47+
id: download-artifact
48+
uses: actions/download-artifact@v8
49+
with:
50+
path: ./artifact
51+
run-id: ${{ github.event.workflow_run.id }}
52+
github-token: ${{ github.token }}
53+
merge-multiple: true
54+
skip-decompress: true
55+
56+
- name: Merge artifacts
57+
id: move_artifacts
58+
run: |
59+
mkdir -p release
60+
61+
# the windows-cpu zip contains the full toolset (llama-server with the embedded
62+
# UI, ggml-cpu) - inject it into the other windows zips so that every archive
63+
# ships the same binaries, only with a different backend library on top
64+
echo "Injecting windows-cpu binaries (llama-server + CPU backend) into the backend zips..."
65+
for arch in x64 arm64; do
66+
cpu_zip="artifact/llama-bin-win-cpu-${arch}.zip"
67+
temp_dir=$(mktemp -d)
68+
echo "Extracting windows-cpu-${arch} package..."
69+
unzip "$cpu_zip" -d "$temp_dir"
70+
71+
echo "Merging into $arch zips..."
72+
for target_zip in artifact/llama-bin-win-*-${arch}.zip; do
73+
if [[ "$target_zip" == "$cpu_zip" ]]; then
74+
continue
75+
fi
76+
echo "Injecting into $(basename "$target_zip")"
77+
realpath_target_zip=$(realpath "$target_zip")
78+
(cd "$temp_dir" && zip -r "$realpath_target_zip" .)
79+
done
80+
81+
rm -rf "$temp_dir"
82+
done
83+
84+
echo "Renaming and moving zips to release..."
85+
for zip_file in artifact/llama-bin-win-*.zip; do
86+
base_name=$(basename "$zip_file" .zip)
87+
zip_name="llama-${{ steps.tag.outputs.name }}-${base_name#llama-}.zip"
88+
echo "Moving $zip_file to release/$zip_name"
89+
mv "$zip_file" "release/$zip_name"
90+
done
91+
92+
echo "Moving other artifacts..."
93+
mv -v artifact/*.zip release
94+
mv -v artifact/*.tar.gz release
95+
96+
- name: Download UI build
97+
id: download_ui
98+
uses: actions/download-artifact@v8
99+
with:
100+
name: llama-ui.zip
101+
path: ./ui-dist
102+
run-id: ${{ github.event.workflow_run.id }}
103+
github-token: ${{ github.token }}
104+
105+
- name: Package UI
106+
id: package_ui
107+
run: |
108+
tar -czvf release/llama-${{ steps.tag.outputs.name }}-ui.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C ./ui-dist .
109+
110+
- name: Attest release artifacts
111+
id: attest
112+
uses: actions/attest@v4
113+
with:
114+
subject-path: 'release/*'
115+
116+
- name: Create and push git tag
117+
run: |
118+
TAG="${{ steps.tag.outputs.name }}"
119+
if git rev-parse -q --verify "refs/tags/${TAG}" >/dev/null 2>&1; then
120+
echo "Tag ${TAG} already exists, skipping creation"
121+
else
122+
git tag "${TAG}"
123+
git push origin "${TAG}"
124+
fi
125+
126+
- name: Create release
127+
id: create_release
128+
uses: ggml-org/action-create-release@v1
129+
env:
130+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
131+
with:
132+
tag_name: ${{ steps.tag.outputs.name }}
133+
prerelease: true
134+
body: |
135+
<details open>
136+
137+
${{ github.event.workflow_run.head_commit.message }}
138+
139+
</details>
140+
141+
**Website:**
142+
- <https://llama.app>
143+
144+
**Attestations:**
145+
- <${{ steps.attest.outputs.attestation-url }}>
146+
147+
**macOS/iOS:**
148+
- [macOS Apple Silicon (arm64)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-macos-arm64.tar.gz)
149+
- macOS Apple Silicon (arm64, KleidiAI enabled) [DISABLED](https://github.com/ggml-org/llama.cpp/pull/23780)
150+
- [macOS Intel (x64)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-macos-x64.tar.gz)
151+
- [iOS XCFramework](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-xcframework.zip)
152+
153+
**Linux:**
154+
- [Ubuntu x64 (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-x64.tar.gz)
155+
- [Ubuntu arm64 (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-arm64.tar.gz)
156+
- [Ubuntu s390x (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-s390x.tar.gz)
157+
- [Ubuntu x64 (Vulkan)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-x64.tar.gz)
158+
- [Ubuntu arm64 (Vulkan)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-arm64.tar.gz)
159+
- [Ubuntu x64 (CUDA 12)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-12.8-x64.tar.gz) - [CUDA 12.8 libraries](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/cudart-llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-12.8-x64.tar.gz)
160+
- [Ubuntu x64 (CUDA 13)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-13.4-x64.tar.gz) - [CUDA 13.4 libraries](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/cudart-llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-13.4-x64.tar.gz)
161+
- [Ubuntu arm64 (CUDA 13)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-13.4-arm64.tar.gz) - [CUDA 13.4 libraries](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/cudart-llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-13.4-arm64.tar.gz)
162+
- [Ubuntu x64 (ROCm 10.0)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-rocm-10.0-x64.tar.gz)
163+
- [Ubuntu x64 (OpenVINO)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-openvino-${{ needs.ubuntu-24-openvino.outputs.openvino_version }}-x64.tar.gz)
164+
- [Ubuntu x64 (SYCL FP32)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-sycl-fp32-x64.tar.gz)
165+
- [Ubuntu x64 (SYCL FP16)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-sycl-fp16-x64.tar.gz)
166+
- [Linux arm64 (Snapdragon: CPU, Adreno GPU, Hexagon NPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-linux-arm64-snapdragon.tar.gz) - [setup guide](https://github.com/ggml-org/llama.cpp/blob/master/docs/backend/snapdragon/linux.md)
167+
168+
**Android:**
169+
- [Android arm64 (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-android-arm64.tar.gz)
170+
- [Android arm64 (Snapdragon: CPU, Adreno GPU, Hexagon NPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-android-arm64-snapdragon.tar.gz) - [setup guide](https://github.com/ggml-org/llama.cpp/blob/master/docs/backend/snapdragon/README.md)
171+
172+
**Windows:**
173+
- [Windows x64 (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-cpu-x64.zip)
174+
- [Windows arm64 (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-cpu-arm64.zip)
175+
- [Windows arm64 (OpenCL Adreno)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-opencl-adreno-arm64.zip)
176+
- [Windows x64 (CUDA 12)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-cuda-12.4-x64.zip) - [CUDA 12.4 DLLs](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/cudart-llama-bin-win-cuda-12.4-x64.zip)
177+
- [Windows x64 (CUDA 13)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-cuda-13.4-x64.zip) - [CUDA 13.4 DLLs](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/cudart-llama-bin-win-cuda-13.4-x64.zip)
178+
- [Windows arm64 (CUDA 13)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-cuda-13.4-arm64.zip) - [CUDA 13.4 DLLs](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/cudart-llama-bin-win-cuda-13.4-arm64.zip)
179+
- [Windows x64 (Vulkan)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-vulkan-x64.zip)
180+
- [Windows x64 (OpenVINO)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-openvino-${{ needs.windows-openvino.outputs.openvino_version }}-x64.zip)
181+
- [Windows x64 (SYCL)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-sycl-x64.zip)
182+
- [Windows x64 (ROCm 10.0)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-rocm-10.0-x64.zip)
183+
184+
**openEuler:**
185+
- [DISABLED](https://github.com/ggml-org/llama.cpp/pull/23705)
186+
- openEuler x86 (310p)
187+
- openEuler x86 (910b, ACL Graph)
188+
- openEuler aarch64 (310p)
189+
- openEuler aarch64 (910b, ACL Graph)
190+
191+
**UI:**
192+
- [UI](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-ui.tar.gz)
193+
194+
- name: Upload release
195+
id: upload_release
196+
uses: actions/github-script@v8
197+
with:
198+
github-token: ${{secrets.GITHUB_TOKEN}}
199+
script: |
200+
const path = require('path');
201+
const fs = require('fs');
202+
const release_id = '${{ steps.create_release.outputs.id }}';
203+
for (let file of await fs.readdirSync('./release')) {
204+
if (path.extname(file) === '.zip' || file.endsWith('.tar.gz')) {
205+
console.log('uploadReleaseAsset', file);
206+
await github.rest.repos.uploadReleaseAsset({
207+
owner: context.repo.owner,
208+
repo: context.repo.repo,
209+
release_id: release_id,
210+
name: file,
211+
data: await fs.readFileSync(`./release/${file}`)
212+
});
213+
}
214+
}
215+
216+
ui-publish:
217+
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.jobs.check-release.outputs.should_release == 'true' }}
218+
219+
needs:
220+
- publish
221+
222+
uses: ./.github/workflows/ui-publish.yml
223+
with:
224+
version_tag: ${{ needs.publish.outputs.tag_name }}
225+
secrets:
226+
hf_token: ${{ secrets.HF_TOKEN_UI_STATIC_OUTPUT }}

0 commit comments

Comments
 (0)