Skip to content

Commit b046ae4

Browse files
l3utterflyCopilot
andcommitted
add GitHub Actions workflow for build and release process
Co-authored-by: Copilot <copilot@github.com>
1 parent acdcfb9 commit b046ae4

1 file changed

Lines changed: 90 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Build & Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
build-windows:
12+
runs-on: windows-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 20
22+
cache: yarn
23+
24+
- name: Install dependencies
25+
run: yarn install --frozen-lockfile
26+
27+
- name: Get latest llama.cpp release tag
28+
id: llama
29+
shell: bash
30+
run: |
31+
TAG=$(curl -s https://api.github.com/repos/ggml-org/llama.cpp/releases/latest | jq -r '.tag_name')
32+
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
33+
echo "Latest llama.cpp release: $TAG"
34+
35+
- name: Download llama.cpp CUDA binaries
36+
shell: bash
37+
run: |
38+
TAG="${{ steps.llama.outputs.tag }}"
39+
URL="https://github.com/ggml-org/llama.cpp/releases/download/${TAG}/llama-${TAG}-bin-win-cuda-13.1-x64.zip"
40+
echo "Downloading $URL"
41+
curl -L -o llama-cuda.zip "$URL"
42+
43+
- name: Download llama.cpp CUDA runtime
44+
shell: bash
45+
run: |
46+
TAG="${{ steps.llama.outputs.tag }}"
47+
URL="https://github.com/ggml-org/llama.cpp/releases/download/${TAG}/cudart-llama-bin-win-cuda-13.1-x64.zip"
48+
echo "Downloading $URL"
49+
curl -L -o llama-cudart.zip "$URL"
50+
51+
- name: Extract and merge into assets/server
52+
shell: bash
53+
run: |
54+
mkdir -p assets/server
55+
56+
# Extract CUDA binaries first
57+
unzip -o llama-cuda.zip -d llama-cuda-tmp
58+
# Extract CUDA runtime
59+
unzip -o llama-cudart.zip -d llama-cudart-tmp
60+
61+
# Copy CUDA files (base layer)
62+
cp -r llama-cuda-tmp/*/* assets/server/ 2>/dev/null || cp -r llama-cuda-tmp/* assets/server/
63+
# Overlay CUDA runtime files (merges on top)
64+
cp -r llama-cudart-tmp/*/* assets/server/ 2>/dev/null || cp -r llama-cudart-tmp/* assets/server/
65+
66+
echo "Contents of assets/server:"
67+
ls -la assets/server/
68+
69+
- name: Build Electron app
70+
run: yarn dist
71+
72+
- name: Upload artifact
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: layla-server-win
76+
path: |
77+
output/*.exe
78+
output/*.yml
79+
if-no-files-found: warn
80+
81+
- name: Create GitHub Release
82+
if: github.ref == 'refs/heads/main'
83+
uses: softprops/action-gh-release@v2
84+
with:
85+
tag_name: v${{ github.run_number }}
86+
name: Layla Server Build ${{ github.run_number }}
87+
files: |
88+
output/*.exe
89+
draft: false
90+
prerelease: false

0 commit comments

Comments
 (0)