Skip to content

Commit 13116d8

Browse files
milzamszclaude
andcommitted
ci(release): publish latest.json when ANY platform build succeeds
Previously the manifest job had `needs: build` (no `if`), so if any matrix entry failed (e.g. macOS missing certs, Linux apt drift) the manifest never ran and the in-app updater on already-installed machines never saw the new version — even though a perfectly good Windows installer was attached to the release. - `if: !cancelled()` lets the manifest step run as long as the run isn't manually cancelled. - The merge step now exits cleanly (without writing latest.json) when zero platform manifests were downloaded OR the merged result has zero platforms, so we never push an empty `platforms: {}` to the site (which would be worse than leaving it stale). - The downstream checkout / copy / commit steps are gated on `has_manifest == 'true'`. - Corrected the destination path on flaredeck-dev: the monorepo's website public dir is at `apps/website/public/latest.json`, not the repo root `public/`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d54ec45 commit 13116d8

1 file changed

Lines changed: 29 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,13 @@ jobs:
8585

8686
manifest:
8787
name: Update latest.json on flaredeck-web
88+
# Run as long as the workflow wasn't cancelled. Even if some platform
89+
# builds failed (e.g. macOS missing certs, Linux apt deps drift),
90+
# we still want to publish the platforms that DID ship — a
91+
# Windows-only release is still useful, and installed users on any
92+
# other OS just stay on their current version until the next tag.
8893
needs: build
94+
if: ${{ !cancelled() }}
8995
runs-on: ubuntu-latest
9096
steps:
9197
- name: Resolve tag
@@ -109,11 +115,16 @@ jobs:
109115
ls -la artifacts
110116
111117
- name: Merge per-platform manifests
118+
id: merge
112119
run: |
113120
node -e '
114121
const fs = require("node:fs");
115122
const path = require("node:path");
116123
const files = fs.readdirSync("artifacts").filter(f => f.endsWith(".json"));
124+
if (files.length === 0) {
125+
console.log("No platform manifests found in artifacts/. Skipping latest.json update.");
126+
process.exit(0);
127+
}
117128
const merged = { version: "", notes: "", pub_date: new Date().toISOString(), platforms: {} };
118129
for (const f of files) {
119130
const data = JSON.parse(fs.readFileSync(path.join("artifacts", f), "utf8"));
@@ -122,33 +133,45 @@ jobs:
122133
if (data.pub_date) merged.pub_date = data.pub_date;
123134
if (data.platforms) Object.assign(merged.platforms, data.platforms);
124135
}
136+
if (Object.keys(merged.platforms).length === 0) {
137+
console.log("Merged manifest has no platforms. Skipping latest.json update.");
138+
process.exit(0);
139+
}
125140
fs.writeFileSync("latest.json", JSON.stringify(merged, null, 2));
126-
console.log(merged);
141+
console.log(JSON.stringify(merged, null, 2));
127142
'
143+
if [ -f latest.json ]; then
144+
echo "has_manifest=true" >> "$GITHUB_OUTPUT"
145+
else
146+
echo "has_manifest=false" >> "$GITHUB_OUTPUT"
147+
fi
128148
129149
- name: Checkout flaredeck-web
150+
if: steps.merge.outputs.has_manifest == 'true'
130151
uses: actions/checkout@v4
131152
with:
132-
repository: ${{ secrets.WEB_REPO }} # e.g. milzamsz/flaredeck-web
153+
repository: ${{ secrets.WEB_REPO }} # e.g. milzamsz/flaredeck-dev
133154
token: ${{ secrets.WEB_REPO_PAT }} # PAT with `contents:write` on the web repo
134155
path: web
135156

136157
- name: Copy latest.json into the web repo
158+
if: steps.merge.outputs.has_manifest == 'true'
137159
run: |
138160
set -e
139-
mkdir -p web/public
140-
cp latest.json web/public/latest.json
161+
mkdir -p web/apps/website/public
162+
cp latest.json web/apps/website/public/latest.json
141163
142164
- name: Commit and push
165+
if: steps.merge.outputs.has_manifest == 'true'
143166
working-directory: web
144167
run: |
145168
set -e
146169
git config user.name "flaredeck-releaser"
147170
git config user.email "releaser@flaredeck.com"
148-
if git diff --quiet public/latest.json; then
171+
if git diff --quiet apps/website/public/latest.json; then
149172
echo "No change to latest.json — skipping commit."
150173
exit 0
151174
fi
152-
git add public/latest.json
175+
git add apps/website/public/latest.json
153176
git commit -m "release: update latest.json for ${{ steps.tag.outputs.tag }}"
154177
git push

0 commit comments

Comments
 (0)