Skip to content

Commit 5b52c7a

Browse files
pmaxhoganclaude
andauthored
ci(release): drop stray latest.json from release assets (#52)
## Summary `tauri-apps/tauri-action` attaches a `latest.json` updater manifest to the GitHub Release on publish even though the build job sets `uploadUpdaterJson: false`. The app uses Cloudflare-hosted, channel-in-path manifests (`updates/<channel>/<os>/<arch>/update.json`), so the stray target-flat `latest.json` is harmless but is confusing clutter on the Release assets (issue #29). This adds an idempotent post-publish cleanup step that deletes any `latest.json` asset from the just-created GitHub Release for the pushed tag. ### What changed - `.github/workflows/release.yml`: new step `Remove stray latest.json from the release` in the `publish-updater-manifest` job. - That job runs ONCE (`needs: build`), so it executes only after every matrix build's `tauri-action` upload has completed. It already has the tag (`RELEASE_TAG: ${{ github.ref_name }}`, job-level env - not hardcoded) and `GITHUB_TOKEN`, so the cleanup runs exactly once after all assets exist. - Idempotent: it queries `gh release view "$RELEASE_TAG" --json assets` for an asset named `latest.json` and only calls `gh release delete-asset "$RELEASE_TAG" latest.json --yes` when one is present; otherwise it logs and exits 0. The `gh release view ... --json assets --jq` / `gh release delete-asset ... --yes` forms match the patterns already used in `dev-channel.yml`. ### Why `uploadUpdaterJson: false` does not suppress it `src-tauri/tauri.conf.json` sets `bundle.createUpdaterArtifacts: true`, so the Tauri bundler emits updater artifacts and tauri-action generates a `latest.json`. Per the tauri-action `action.yml` + docs (verified via Context7), `uploadUpdaterJson` (default `true`) is the correct input and the current `dev` branch gates the upload on it (`if (shouldUploadUpdaterJson) { uploadVersionJSON(...) }`). However this repo pins the floating `tauri-apps/tauri-action@v0` major tag, whose resolved build does not match that current `dev`-branch logic, so the generated `latest.json` is still attached despite the flag. The input name itself is correct (a previous codex pass already confirmed `includeUpdaterJson` does not exist), so renaming is not the fix - the robust fix shipped here is the post-publish delete. ### Why dev-channel.yml is unchanged `dev-channel.yml`'s `tauri-action` step has NO `tagName`, so it builds only and creates/uploads no release (and thus no `latest.json`). The rolling `dev` pre-release is assembled by `softprops/action-gh-release` from `dev-artifacts/*`, which is populated by a `find` allow-list (`.dmg`, `.app.tar.gz(.sig)`, `.msi(.sig)`, `-setup.exe(.sig)`, `.AppImage(.sig)`, `.deb`) that excludes `latest.json`. And even if a `latest.json` ever did land there, the existing `gc-stale-dev-assets` job already deletes every asset not carrying the run's dev version. So no cleanup is needed there. ## Testing This is YAML/CI only - no app code changed, so the pnpm/cargo gates were skipped per the task. Validation run: - `actionlint .github/workflows/release.yml` - PASS - `actionlint .github/workflows/dev-channel.yml` - PASS (unchanged, sanity check) - `python -c "import yaml; yaml.safe_load(open('.github/workflows/release.yml'))"` - parses - `python -c "import yaml; yaml.safe_load(open('.github/workflows/dev-channel.yml'))"` - parses - `git diff | grep -P '[^\x00-\x7F]'` - no non-ASCII introduced; file remains LF ASCII text - Step ordering verified: the cleanup lives in `publish-updater-manifest` (`needs: build`), so it runs after all `tauri-action` uploads; `RELEASE_TAG` resolves from job-level `github.ref_name`. This cannot be fully proven until the next real tagged release exercises `release.yml` end to end (the cleanup only runs on a `v*` tag push). The idempotent `delete-asset` + actionlint/YAML lint is the ceiling here; the delete is a safe no-op if `latest.json` is ever absent. Closes #29 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01MZQh3ZfwtZsM6c5qnTuWZP Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 4084b78 commit 5b52c7a

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,39 @@ jobs:
173173
with:
174174
node-version: 22
175175

176+
# Issue #29: drop the stray `latest.json` updater manifest tauri-action
177+
# attaches to the GitHub Release. `uploadUpdaterJson: false` (set on the
178+
# build job's tauri-action step, verified the correct input name) is SUPPOSED
179+
# to suppress it, but it does not reliably do so on the floating
180+
# `tauri-apps/tauri-action@v0` tag: tauri.conf.json sets
181+
# `createUpdaterArtifacts: true`, so the bundler emits updater artifacts and
182+
# the pinned `@v0` build still uploads a generated `latest.json` (a
183+
# tauri-action version quirk - the current `dev` branch gates the upload on
184+
# the flag, but the resolved `@v0` build's behavior differs). Driven serves
185+
# its own channel-in-path manifests from Cloudflare Pages
186+
# (updates/<channel>/<os>/<arch>/update.json), so a target-flat `latest.json`
187+
# on the Release is just confusing clutter. Delete it post-publish. This job
188+
# runs ONCE (needs: build) after every matrix build's tauri-action upload has
189+
# completed and has the tag (RELEASE_TAG) + GITHUB_TOKEN, so the cleanup
190+
# happens exactly once after all assets exist. Idempotent: a no-op (exit 0)
191+
# when no `latest.json` asset is present.
192+
- name: Remove stray latest.json from the release
193+
env:
194+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
195+
run: |
196+
set -euo pipefail
197+
has_latest="$(gh release view "$RELEASE_TAG" \
198+
--repo "$GITHUB_REPOSITORY" \
199+
--json assets \
200+
--jq '[.assets[] | select(.name == "latest.json")] | length')"
201+
if [ "${has_latest:-0}" -gt 0 ]; then
202+
echo "deleting stray latest.json from release $RELEASE_TAG"
203+
gh release delete-asset "$RELEASE_TAG" latest.json --yes \
204+
--repo "$GITHUB_REPOSITORY"
205+
else
206+
echo "no latest.json asset on release $RELEASE_TAG (nothing to clean up)"
207+
fi
208+
176209
# R1-P1-2: the generator reads bundles + `.sig` from a local dir, but the
177210
# matrix build artifacts live as GitHub Release assets. Download the
178211
# just-published release's assets into a flat dir so the generator has real

0 commit comments

Comments
 (0)