Skip to content

Commit 4208fcd

Browse files
authored
fix: desktop auto-update pipeline (updater targets, latest.json v2 names, versioned bundles) (#1723)
1 parent 17fb17e commit 4208fcd

3 files changed

Lines changed: 60 additions & 31 deletions

File tree

.github/workflows/release.yml

Lines changed: 56 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,18 @@ jobs:
6868
- name: Use npm registry (yarnpkg.com has intermittent 500s)
6969
run: yarn config set registry https://registry.npmjs.org
7070

71+
# Patch the desktop version from the tag BEFORE any Tauri build so every
72+
# bundle (and the updater metadata) carries the release version — no
73+
# stale 0.1.0 artifacts from intermediate builds.
74+
- name: Patch desktop version from tag
75+
if: startsWith(github.ref, 'refs/tags/v')
76+
shell: bash
77+
run: |
78+
V="${GITHUB_REF_NAME#v}"
79+
jq --arg v "$V" '.version = $v' packages/silex-desktop/src-tauri/tauri.conf.json > /tmp/tauri.conf.json
80+
mv /tmp/tauri.conf.json packages/silex-desktop/src-tauri/tauri.conf.json
81+
echo "Desktop version set to $V"
82+
7183
- name: Install JS dependencies and build frontend
7284
shell: bash
7385
run: yarn install --ignore-scripts && yarn run build
@@ -84,14 +96,6 @@ jobs:
8496
# ── silex-desktop (Tauri) ────────────────────────────────────
8597
# Build Tauri first — it compiles silex-server as a library dependency.
8698
# The standalone server build below reuses the cached compilation.
87-
# Compute the monorepo version (tag without the leading 'v') so Tauri
88-
# bundles the artifacts as Silex_<tag>_*.deb etc.
89-
- name: Compute release version
90-
if: startsWith(github.ref, 'refs/tags/v')
91-
id: release_version
92-
shell: bash
93-
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
94-
9599
# Sign updater artifacts only on tag pushes (secrets unavailable on fork PRs).
96100
- name: Build Tauri app (signed)
97101
if: startsWith(github.ref, 'refs/tags/v')
@@ -104,7 +108,7 @@ jobs:
104108
with:
105109
projectPath: packages/silex-desktop
106110
tauriScript: yarn tauri
107-
args: --config '{"version":"${{ steps.release_version.outputs.version }}"}' ${{ matrix.rust-target && format('--target {0}', matrix.rust-target) || '' }}
111+
args: ${{ matrix.rust-target && format('--target {0}', matrix.rust-target) || '' }}
108112

109113
# Write a temp config to disable updater artifacts (they require signing keys)
110114
- name: Disable updater artifacts config
@@ -131,7 +135,7 @@ jobs:
131135
name: silex-desktop-${{ matrix.platform }}
132136
path: |
133137
target/**/release/bundle/**/*.dmg
134-
target/**/release/bundle/**/*.app
138+
target/**/release/bundle/**/*.AppImage
135139
target/**/release/bundle/**/*.deb
136140
target/**/release/bundle/**/*.rpm
137141
target/**/release/bundle/**/*.exe
@@ -211,34 +215,59 @@ jobs:
211215
find artifacts/silex-server-macos-x64 -name 'silex-server' -type f -exec cp {} release/silex-server-macos-x64 \;
212216
find artifacts/silex-server-windows -name 'silex-server.exe' -type f -exec cp {} release/silex-server-windows-amd64.exe \;
213217
214-
# Desktop installers + updater artifacts (flatten into release/)
218+
# Desktop installers + updater artifacts (flatten into release/).
219+
# Tauri v2 updater artifacts are the bundles themselves + .sig:
220+
# Linux = .AppImage, macOS = .app.tar.gz, Windows = -setup.exe.
221+
# NB: deb staging dirs contain control.tar.gz/data.tar.gz — not matched here.
215222
find artifacts/silex-desktop-* -type f \
216-
\( -name '*.deb' -o -name '*.rpm' -o -name '*.dmg' -o -name '*.exe' \
217-
-o -name '*.tar.gz' -o -name '*.tar.gz.sig' \
218-
-o -name '*.zip' -o -name '*.zip.sig' \) \
223+
\( -name '*.deb' -o -name '*.rpm' -o -name '*.dmg' -o -name '*-setup.exe' \
224+
-o -name '*.AppImage' -o -name '*.AppImage.sig' -o -name '*-setup.exe.sig' \
225+
-o -name '*.AppImage.tar.gz' -o -name '*.AppImage.tar.gz.sig' \) \
219226
-exec cp {} release/ \;
220227
228+
# macOS updater bundles are named Silex.app.tar.gz on both arches —
229+
# rename per-arch while copying so they don't overwrite each other.
230+
V="${VERSION#v}"
231+
for pair in "macos-arm aarch64" "macos-x64 x64"; do
232+
set -- $pair
233+
SRC=$(find "artifacts/silex-desktop-$1" -name '*.app.tar.gz' ! -name '*.sig' | head -1)
234+
if [ -n "$SRC" ]; then
235+
cp "$SRC" "release/Silex_${V}_$2.app.tar.gz"
236+
cp "$SRC.sig" "release/Silex_${V}_$2.app.tar.gz.sig" 2>/dev/null || true
237+
fi
238+
done
239+
221240
# Helper: find file + read its .sig
222241
sig() { cat "$1.sig" 2>/dev/null || echo ""; }
223242
224-
# Build latest.json for the Tauri updater
243+
# Build latest.json for the Tauri updater (v2 artifact names)
225244
BASE="https://github.com/${REPO}/releases/download/${VERSION}"
226-
LINUX_TAR=$(find release -name '*_amd64.tar.gz' ! -name '*.sig' | head -1)
227-
MACOS_ARM_TAR=$(find release -name '*_aarch64.app.tar.gz' | head -1)
228-
MACOS_X64_TAR=$(find release -name '*_x64.app.tar.gz' | head -1)
229-
WINDOWS_ZIP=$(find release -name '*_x64-setup*.zip' ! -name '*.sig' | head -1)
245+
LINUX_BUNDLE=$(find release -name '*_amd64.AppImage' ! -name '*.sig' | head -1)
246+
[ -z "$LINUX_BUNDLE" ] && LINUX_BUNDLE=$(find release -name '*_amd64.AppImage.tar.gz' ! -name '*.sig' | head -1)
247+
MACOS_ARM_BUNDLE=$(find release -name '*_aarch64.app.tar.gz' ! -name '*.sig' | head -1)
248+
MACOS_X64_BUNDLE=$(find release -name '*_x64.app.tar.gz' ! -name '*.sig' | head -1)
249+
WINDOWS_BUNDLE=$(find release -name '*_x64-setup.exe' ! -name '*.sig' | head -1)
250+
251+
# Fail loudly if an updater bundle is missing — an empty URL in
252+
# latest.json silently breaks auto-update for that platform.
253+
for f in "$LINUX_BUNDLE" "$MACOS_ARM_BUNDLE" "$MACOS_X64_BUNDLE" "$WINDOWS_BUNDLE"; do
254+
if [ -z "$f" ] || [ -z "$(sig "$f")" ]; then
255+
echo "::error::Missing updater bundle or signature (linux='$LINUX_BUNDLE' macos-arm='$MACOS_ARM_BUNDLE' macos-x64='$MACOS_X64_BUNDLE' windows='$WINDOWS_BUNDLE')"
256+
exit 1
257+
fi
258+
done
230259
231260
jq -n \
232261
--arg ver "${VERSION#v}" \
233262
--arg date "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
234-
--arg lu "${BASE}/$(basename "$LINUX_TAR")" \
235-
--arg ls "$(sig "$LINUX_TAR")" \
236-
--arg mau "${BASE}/$(basename "$MACOS_ARM_TAR")" \
237-
--arg mas "$(sig "$MACOS_ARM_TAR")" \
238-
--arg mxu "${BASE}/$(basename "$MACOS_X64_TAR")" \
239-
--arg mxs "$(sig "$MACOS_X64_TAR")" \
240-
--arg wu "${BASE}/$(basename "$WINDOWS_ZIP")" \
241-
--arg ws "$(sig "$WINDOWS_ZIP")" \
263+
--arg lu "${BASE}/$(basename "$LINUX_BUNDLE")" \
264+
--arg ls "$(sig "$LINUX_BUNDLE")" \
265+
--arg mau "${BASE}/$(basename "$MACOS_ARM_BUNDLE")" \
266+
--arg mas "$(sig "$MACOS_ARM_BUNDLE")" \
267+
--arg mxu "${BASE}/$(basename "$MACOS_X64_BUNDLE")" \
268+
--arg mxs "$(sig "$MACOS_X64_BUNDLE")" \
269+
--arg wu "${BASE}/$(basename "$WINDOWS_BUNDLE")" \
270+
--arg ws "$(sig "$WINDOWS_BUNDLE")" \
242271
'{
243272
version: $ver, pub_date: $date,
244273
platforms: {

packages/silex-desktop

scripts/generate-changelog.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ echo ""
286286
echo "Install Silex on your computer."
287287
echo ""
288288
if [[ -n "$DESKTOP_VERSION" ]]; then
289-
echo "- **Linux**: [.deb installer](${BASE}/Silex_${DESKTOP_VERSION}_amd64.deb) · [.rpm installer](${BASE}/Silex-${DESKTOP_VERSION}-1.x86_64.rpm)"
289+
echo "- **Linux**: [.AppImage (auto-updates)](${BASE}/Silex_${DESKTOP_VERSION}_amd64.AppImage) · [.deb installer](${BASE}/Silex_${DESKTOP_VERSION}_amd64.deb) · [.rpm installer](${BASE}/Silex-${DESKTOP_VERSION}-1.x86_64.rpm)"
290290
echo "- **macOS** (Apple Silicon): [.dmg](${BASE}/Silex_${DESKTOP_VERSION}_aarch64.dmg)"
291291
echo "- **macOS** (Intel): [.dmg](${BASE}/Silex_${DESKTOP_VERSION}_x64.dmg)"
292292
echo "- **Windows**: [setup.exe](${BASE}/Silex_${DESKTOP_VERSION}_x64-setup.exe)"
@@ -295,9 +295,9 @@ else
295295
fi
296296
echo ""
297297

298-
echo "### Self-hosted server"
298+
echo "### Server binary (advanced)"
299299
echo ""
300-
echo "Host Silex on a server for your team. Single static binary, no Node.js install needed."
300+
echo "The standalone server embedded in Silex Desktop — useful to try Silex from the command line. Not meant for production self-hosting (no OAuth): to self-host Silex, follow [the docs](https://docs.silex.me) (Docker or Node.js)."
301301
echo ""
302302
echo "- [Linux x64](${BASE}/silex-server-linux-amd64)"
303303
echo "- [macOS Apple Silicon](${BASE}/silex-server-macos-arm64)"

0 commit comments

Comments
 (0)