Skip to content

Commit f3f79c7

Browse files
fix(dashboard-release): create release once, eliminating arch-split drafts
v0.8.3 came out split across TWO draft releases for one tag: each matrix leg called tauri-action with releaseDraft:true + tagName, so when two legs started simultaneously they both found no existing release and each created its own draft. The x64 legs landed on one draft, arm64 on another, and deploy-updater grabbed only one draft's latest.json — shipping an x64-only updater manifest that 404'd (draft assets) and omitted Apple Silicon entirely. Fix (the documented tauri-action multi-platform pattern): - New create-release job makes the draft ONCE (reuses on re-run), outputs its id. - Build matrix and uploads via releaseId (not tagName), so every leg targets the same release and tauri-action merges one complete latest.json across all 6 platforms. - release-dashboard.sh asset floor 10 -> 24: a full run is 25 assets; 24 catches an arch split (~12-14) as a backstop even if the race ever recurs. v0.8.3 itself was already consolidated + republished manually (25 assets, full 17-platform updater manifest live); this prevents recurrence. Co-authored-by: Alfonso [Magic Context] <288211368+alfonso-magic-context@users.noreply.github.com>
1 parent d184f8c commit f3f79c7

2 files changed

Lines changed: 48 additions & 4 deletions

File tree

.github/workflows/dashboard-release.yml

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,47 @@ env:
1313
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
1414

1515
jobs:
16+
# Create the draft release ONCE, up front, and hand its id to every build leg.
17+
# The previous design let each matrix leg create-or-find the release by tagName;
18+
# when two legs started simultaneously they both saw "no release yet" and each
19+
# created its own draft, splitting the platform assets (and the per-arch
20+
# latest.json) across two drafts for the same tag. Creating it here first means
21+
# every leg uploads into the same release, so tauri-action merges one complete
22+
# latest.json across all architectures.
23+
create-release:
24+
name: Create draft release
25+
runs-on: ubuntu-latest
26+
outputs:
27+
release_id: ${{ steps.create.outputs.result }}
28+
steps:
29+
- id: create
30+
uses: actions/github-script@v7
31+
with:
32+
result-encoding: string
33+
script: |
34+
const ref = process.env.GITHUB_REF_NAME;
35+
const { owner, repo } = context.repo;
36+
// Reuse an existing release for this tag (re-runs), else create a draft.
37+
try {
38+
const ex = await github.rest.repos.getReleaseByTag({ owner, repo, tag: ref });
39+
core.info(`Reusing existing release ${ex.data.id} for ${ref}`);
40+
return String(ex.data.id);
41+
} catch (e) {
42+
if (e.status !== 404) throw e;
43+
}
44+
const created = await github.rest.repos.createRelease({
45+
owner, repo,
46+
tag_name: ref,
47+
name: `Dashboard ${ref}`,
48+
draft: true,
49+
prerelease: false,
50+
});
51+
core.info(`Created draft release ${created.data.id} for ${ref}`);
52+
return String(created.data.id);
53+
1654
build:
1755
name: Build Dashboard (${{ matrix.settings.label }})
56+
needs: create-release
1857
# Harden cargo against the transient crates.io drops we hit in the wild
1958
# ("download of … failed / curl … Connection reset by peer" mid-build, which
2059
# killed a single matrix leg ~23s in despite the code being fine). Retry hard
@@ -130,9 +169,10 @@ jobs:
130169
tauriScript: bunx tauri
131170
args: --target ${{ matrix.settings.target }}${{ matrix.settings.bundles && format(' --bundles {0}', matrix.settings.bundles) || '' }}
132171
updaterJsonPreferNsis: true
133-
tagName: ${{ github.ref_name }}
134-
releaseName: "Dashboard ${{ github.ref_name }}"
135-
releaseDraft: true
172+
# Upload into the single pre-created draft (see create-release). Using
173+
# releaseId (not tagName) guarantees every leg targets the same release,
174+
# so there is exactly one release and one merged latest.json per tag.
175+
releaseId: ${{ needs.create-release.outputs.release_id }}
136176
assetNamePattern: magic-context-dashboard-[platform]-${{ matrix.settings.arch }}[ext]
137177
env:
138178
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

scripts/release-dashboard.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,11 @@ fi
256256
# Sanity: the run succeeded, so every leg uploaded its asset. Confirm the count
257257
# before publishing (a defensive check, not a wait — the run is already green).
258258
ASSET_COUNT=$(gh release view "$TAG" --repo cortexkit/magic-context --json assets --jq '.assets | length' 2>/dev/null || echo "0")
259-
MIN_ASSETS=10
259+
# A full run produces 25 assets (6 platforms × installers/sigs + latest.json).
260+
# A floor of 24 catches an architecture split (which yields ~12-14), the failure
261+
# mode where the matrix legs landed on two separate releases. The single
262+
# create-release job now prevents that, but keep the count as a backstop.
263+
MIN_ASSETS=24
260264
if [[ "$ASSET_COUNT" -lt "$MIN_ASSETS" ]]; then
261265
echo " ⚠ Workflow succeeded but only $ASSET_COUNT/$MIN_ASSETS assets are attached."
262266
echo " → https://github.com/cortexkit/magic-context/releases/tag/$TAG"

0 commit comments

Comments
 (0)