Skip to content

Commit 9bdc2c4

Browse files
fix(dashboard-release): pin updater asset URLs to the release tag
tauri-action writes /releases/latest/download/ URLs into latest.json, but this repo has two release trains (plugin v* and dashboard-v*). GitHub's 'latest release' pointer belongs to whichever shipped most recently (usually the plugin), which carries no dashboard assets, so /latest/ URLs 404 and Desktop auto-update breaks. The deploy-updater job now rewrites every asset URL to /releases/download/<TAG>/ before publishing to gh-pages, and fails closed if any /latest/ URL survives. Matches the manual hotfix applied to gh-pages for v0.9.0. Co-authored-by: Alfonso [Magic Context] <288211368+alfonso-magic-context@users.noreply.github.com>
1 parent 6e95caf commit 9bdc2c4

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

.github/workflows/dashboard-release.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,34 @@ jobs:
224224
echo "::error::latest.json never became available on release $TAG"
225225
exit 1
226226
227+
# Pin every asset URL to THIS tag's release. tauri-action writes
228+
# /releases/latest/download/ URLs, but in this repo GitHub's "latest
229+
# release" pointer belongs to the plugin train (v*), which carries no
230+
# dashboard assets — so /latest/ URLs 404 and Desktop auto-update breaks.
231+
# Rewrite to /releases/download/<TAG>/, which is immune to the pointer.
232+
- name: Pin updater URLs to this release tag
233+
run: |
234+
TAG="${{ github.ref_name }}"
235+
FILE=_updater_publish/latest.json
236+
python3 - "$TAG" "$FILE" <<'PY'
237+
import json, sys
238+
tag, path = sys.argv[1], sys.argv[2]
239+
old = "/releases/latest/download/"
240+
new = f"/releases/download/{tag}/"
241+
d = json.load(open(path))
242+
n = 0
243+
for info in d.get("platforms", {}).values():
244+
u = info.get("url", "")
245+
if old in u:
246+
info["url"] = u.replace(old, new); n += 1
247+
json.dump(d, open(path, "w"), indent=2)
248+
print(f"pinned {n} url(s) to {new}")
249+
# Fail closed: a manifest still carrying /latest/ URLs would ship broken.
250+
assert not any(old in i.get("url", "") for i in d.get("platforms", {}).values()), \
251+
"latest.json still has /releases/latest/download/ URLs after rewrite"
252+
PY
253+
cat "$FILE"
254+
227255
- name: Deploy to gh-pages
228256
uses: peaceiris/actions-gh-pages@v4
229257
with:

0 commit comments

Comments
 (0)