Soul-driven AI agent with permission-hardened tools, token budgets, and multi-channel access. Runs 24/7 from CLI, Telegram or More.
release: a patch release touches only the update feeds, not the site
Salman Qureshi0617bc3feb5d
diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex e3023364..0e1a95f6 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -230,6 +230,14 @@ jobs:working-directory: apps/desktop- run: npm ci --no-audit --no-fundworking-directory: website+ # A patch release (x.y.Z, Z > 0) changes only what installed apps read:+ # the update manifest and the desktop update feed. The download page,+ # hero and docs stay as they are (a fresh install updates itself).+ - name: Patch or feature release?+ id: kind+ run: |+ v="${{ needs.server.outputs.version }}"+ if [ "${v##*.}" != "0" ]; then echo "feeds_only=true" >> "$GITHUB_OUTPUT"; else echo "feeds_only=false" >> "$GITHUB_OUTPUT"; fi- name: Point the site and the update manifest at the releaseenv:GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}@@ -237,16 +245,25 @@ jobs:TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}run: |git show "${TAG}:RELEASE.md" > /tmp/RELEASE.md- node scripts/release-site.mjs "${{ needs.server.outputs.version }}" --notes /tmp/RELEASE.md- - name: Rebuild the site (docs/)+ node scripts/release-site.mjs "${{ needs.server.outputs.version }}" --notes /tmp/RELEASE.md ${{ steps.kind.outputs.feeds_only == 'true' && '--feeds-only' || '' }}+ - name: Patch release — copy only the update feeds into the live site+ if: steps.kind.outputs.feeds_only == 'true'+ run: |+ mkdir -p docs/updates docs/desktop+ cp website/static/updates/manifest.json website/static/updates/manifest.json.sig docs/updates/+ cp website/static/desktop/latest.json docs/desktop/+ - name: Feature release — rebuild the site (docs/)+ if: steps.kind.outputs.feeds_only != 'true'working-directory: websiterun: npm run build:prod- - name: Keep the hand-written files docs/ also holds- run: git ls-files -d docs | xargs -r git checkout --+ - name: Keep the hand-written files docs/ also holds, drop stale built assets+ if: steps.kind.outputs.feeds_only != 'true'+ run: |+ git ls-files -d docs | grep -v '^docs/assets/' | xargs -r git checkout --- name: Push to mainrun: |git config user.name "mercury-release[bot]"git config user.email "[email protected]"- git add website/static/desktop website/static/updates website/src/data docs+ git add -A website/static/desktop website/static/updates website/src/data docsgit commit -m "release: v${{ needs.server.outputs.version }} on mercuryagent.sh (downloads, updates, docs)" || { echo "nothing to publish"; exit 0; }git push origin HEAD:maindiff --git a/scripts/release-site.mjs b/scripts/release-site.mjsindex 851c756b..0312b739 100644--- a/scripts/release-site.mjs+++ b/scripts/release-site.mjs@@ -3,7 +3,7 @@* Point the website at a published release (run by .github/workflows/release.yml* after the GitHub release is public; can be run by hand the same way):*- * node scripts/release-site.mjs 1.5.0 [--no-desktop] [--notes RELEASE.md]+ * node scripts/release-site.mjs 1.5.0 [--no-desktop] [--feeds-only] [--notes RELEASE.md]** 1. reads the release's assets from GitHub;* 2. desktop: checks latest.json (every platform has a url and a signature —@@ -13,6 +13,10 @@* 3. records the release in the signed update manifest (server, and desktop* unless --no-desktop) and re-signs it.*+ * --feeds-only (patch releases): only what installed apps read, the update+ * manifest and desktop/latest.json; the download page and hero keep pointing+ * at the release they show (a fresh install then updates itself).+ ** It changes files only; the website goes live when docs/ is rebuilt and pushed.* GITHUB_TOKEN is used when set (higher API limits); the release must be public.*/@@ -26,6 +30,7 @@ const REPO = 'cosmicstack-labs/mercury-agent';const args = process.argv.slice(2);const version = args[0];const withDesktop = !args.includes('--no-desktop');+const feedsOnly = args.includes('--feeds-only');const notesAt = args.indexOf('--notes');const notesFile = notesAt > 0 ? args[notesAt + 1] : join(ROOT, 'RELEASE.md');@@ -63,6 +68,7 @@ if (withDesktop) {writeFileSync(out, `${JSON.stringify(latest, null, 2)}\n`);console.log(`✓ website/static/desktop/latest.json: ${platforms.map(([n]) => n).join(', ')}`);+ if (!feedsOnly) {// The download page: one file per platform, found by the names tauri-action gives them.const find = (re) => {const a = assets.find((x) => re.test(x.name));@@ -104,6 +110,7 @@ if (withDesktop) {mkdirSync(dirname(dl), { recursive: true });writeFileSync(dl, `${JSON.stringify(downloads, null, 2)}\n`);console.log(`✓ website/src/data/desktop-release.json: ${Object.keys(downloads.assets).join(', ')}`);+ }}run('update-manifest.mjs', ['release', 'server', version, '--notes', notesFile, '--url', release.html_url]);