-
Notifications
You must be signed in to change notification settings - Fork 7
92 lines (74 loc) · 2.96 KB
/
Copy pathbuild.yml
File metadata and controls
92 lines (74 loc) · 2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Build & Release
on:
push:
branches: [main]
permissions:
contents: write
jobs:
build-windows:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: yarn
- name: Force git to use HTTPS
run: git config --global url."https://github.com/".insteadOf "ssh://git@github.com/"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Download llama.cpp release binaries
id: llama
shell: bash
run: |
# Fetch all asset download URLs from the latest release
RELEASE=$(curl -s https://api.github.com/repos/ggml-org/llama.cpp/releases/latest)
TAG=$(echo "$RELEASE" | jq -r '.tag_name')
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "Latest llama.cpp release: $TAG"
# List all assets so we can see exact names
echo "$RELEASE" | jq -r '.assets[].name' | head -30
# Find and download the CUDA binary (13.1 only)
CUDA_URL=$(echo "$RELEASE" | jq -r '.assets[] | select(.name | test("bin-win-cuda-13\\.1-x64\\.zip$")) | select(.name | test("cudart") | not) | .browser_download_url')
echo "CUDA binary URL: $CUDA_URL"
curl -fL -o llama-cuda.zip "$CUDA_URL"
# Find and download the CUDA runtime (13.1 only)
CUDART_URL=$(echo "$RELEASE" | jq -r '.assets[] | select(.name | test("cudart.*cuda-13\\.1-x64\\.zip$")) | .browser_download_url')
echo "CUDART URL: $CUDART_URL"
curl -fL -o llama-cudart.zip "$CUDART_URL"
- name: Extract and merge into assets/server
shell: bash
run: |
mkdir -p assets/server
# Extract CUDA binaries first
unzip -o llama-cuda.zip -d llama-cuda-tmp
# Extract CUDA runtime
unzip -o llama-cudart.zip -d llama-cudart-tmp
# Copy CUDA files (base layer)
cp -r llama-cuda-tmp/*/* assets/server/ 2>/dev/null || cp -r llama-cuda-tmp/* assets/server/
# Overlay CUDA runtime files (merges on top)
cp -r llama-cudart-tmp/*/* assets/server/ 2>/dev/null || cp -r llama-cudart-tmp/* assets/server/
echo "Contents of assets/server:"
ls -la assets/server/
- name: Build Electron app
run: yarn dist -- --publish never
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: layla-server-win
path: |
dist/*.exe
dist/*.yml
if-no-files-found: warn
- name: Create GitHub Release
if: github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ github.run_number }}
name: Layla Server Build ${{ github.run_number }}
files: |
dist/*.exe
draft: false
prerelease: false