Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 8 additions & 80 deletions .github/workflows/desktop-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,85 +25,12 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
version="$(gh release list --repo "$GITHUB_REPOSITORY" --limit 1000 --json tagName --jq '.[].tagName' | grep -E '^v[0-9]+\\.[0-9]+\\.[0-9]+
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
cache-dependency-path: apps/desktop/package-lock.json
- uses: dtolnay/rust-toolchain@stable
- uses: swatinem/rust-cache@v2

- name: Install Linux system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev libssl-dev librsvg2-dev libayatana-appindicator3-dev patchelf

- name: Download Linux llama.cpp runtime
if: runner.os == 'Linux'
shell: bash
run: |
set -euo pipefail
python3 - <<'PY'
import json, os, pathlib, urllib.request
headers = {"User-Agent": "deepLocal-CI", "Accept": "application/vnd.github+json"}
request = urllib.request.Request("https://api.github.com/repos/ggml-org/llama.cpp/releases?per_page=10", headers=headers)
with urllib.request.urlopen(request) as response:
releases = json.load(response)
assets = [a for r in releases if not r["draft"] for a in r["assets"]]
matches = [a for a in assets if "ubuntu-x64" in a["name"].lower() and a["name"].endswith(".tar.gz")]
if not matches:
raise SystemExit("No compatible Linux llama.cpp release asset found")
url = matches[0]["browser_download_url"]
urllib.request.urlretrieve(url, "/tmp/llama-runtime.tar.gz")
PY
mkdir -p .tools/llama.cpp
tar -xzf /tmp/llama-runtime.tar.gz -C .tools/llama.cpp
server="$(find .tools/llama.cpp -type f -name llama-server -print -quit)"
test -n "$server"
chmod +x "$server"
echo "DEEPLOCAL_LLAMA_SERVER=$GITHUB_WORKSPACE/$server" >> "$GITHUB_ENV"

- name: Download Windows llama.cpp runtime
if: runner.os == 'Windows'
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$releases = Invoke-RestMethod -Uri 'https://api.github.com/repos/ggml-org/llama.cpp/releases?per_page=10' -Headers @{ 'User-Agent' = 'deepLocal-CI' }
$asset = $releases | Where-Object { -not $_.draft } | ForEach-Object { $_.assets } |
Where-Object { $_.name -match 'win-cpu-x64.*\.zip$' } | Select-Object -First 1
if (-not $asset) { throw 'No compatible Windows llama.cpp release asset found.' }
Invoke-WebRequest -Uri $asset.browser_download_url -OutFile "$env:RUNNER_TEMP\llama-runtime.zip"
New-Item -ItemType Directory -Force '.tools\llama.cpp' | Out-Null
Expand-Archive "$env:RUNNER_TEMP\llama-runtime.zip" '.tools\llama.cpp' -Force
$server = Get-ChildItem '.tools\llama.cpp' -Filter 'llama-server.exe' -Recurse | Select-Object -First 1
if (-not $server) { throw 'llama-server.exe was not found in the downloaded archive.' }
"DEEPLOCAL_LLAMA_SERVER=$($server.FullName)" | Out-File -FilePath $env:GITHUB_ENV -Append

- name: Package Linux
if: runner.os == 'Linux'
shell: bash
run: bash scripts/package-linux-app.sh

- name: Package Windows
if: runner.os == 'Windows'
shell: pwsh
run: ./scripts/package-windows-app.ps1

- name: Upload installers
uses: actions/upload-artifact@v4
with:
name: deeplocal-${{ runner.os }}-${{ runner.arch }}
path: |
dist/*.deb
dist/*.AppImage
dist/*.exe
release-version.txt
if-no-files-found: error
retention-days: 14
| sort -V | tail -n 1 || true)"
if [[ -z "$version" ]]; then version=v0.1.0; else version="$(awk -F. '{printf "v%d.%d.%d", substr($1,2),$2,$3+1}' <<< "$version")"; fi
version="$(gh release list --repo "$GITHUB_REPOSITORY" --limit 1000 --json tagName --jq '.[].tagName' | grep -E '^v[0-9]+\\.[0-9]+\\.[0-9]+$' | sort -V | tail -n 1 || true)"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Fix doubled escapes in the release-tag regex

When the repository contains a release such as v0.1.0, the single-quoted pattern passes two backslashes before each dot to grep, so it does not match ordinary version tags. Consequently, every packaging run falls back to v0.1.0; after the first release, publish-desktop-release.yml lines 59–61 rejects that already-existing version, preventing subsequent releases. Use a single backslash before each dot in this shell regex.

Useful? React with 👍 / 👎.

if [[ -z "$version" ]]; then
version=v0.1.0
else
version="$(awk -F. '{printf "v%d.%d.%d", substr($1,2),$2,$3+1}' <<< "$version")"
fi
echo "DEEPLOCAL_RELEASE_VERSION=$version" >> "$GITHUB_ENV"
echo "$version" > release-version.txt
- uses: actions/setup-node@v4
Expand Down Expand Up @@ -179,5 +106,6 @@ jobs:
dist/*.deb
dist/*.AppImage
dist/*.exe
release-version.txt
if-no-files-found: error
retention-days: 14
retention-days: 14
Loading