AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.
HTML ai-agentcloudflarecloudflare-d1cloudflare-r2cloudflare-workersdockerelectronevernoteevernote-alternativeknowledge-basemcpnote-takingobsidian-alternativeoffline-firstpersonal-knowledge-basepwaself-hostedsqlitetiptapweb-clipper
feat: add macOS Intel release builds
tianma-iffe3c5d1f083b
diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.ymlindex bac17f99..34e14b12 100644--- a/.github/workflows/desktop-build.yml+++ b/.github/workflows/desktop-build.yml@@ -116,9 +116,15 @@ jobs:--repo "$GITHUB_REPOSITORY" \--pattern 'EdgeEver-*-mac-arm64.dmg' \--pattern 'EdgeEver-*-mac-arm64.dmg.blockmap' \+ --pattern 'EdgeEver-*-mac-arm64.zip' \+ --pattern 'EdgeEver-*-mac-arm64.zip.blockmap' \+ --pattern 'EdgeEver-*-mac-x64.dmg' \+ --pattern 'EdgeEver-*-mac-x64.dmg.blockmap' \+ --pattern 'EdgeEver-*-mac-x64.zip' \+ --pattern 'EdgeEver-*-mac-x64.zip.blockmap' \--pattern 'latest-mac.yml' \--dir "$RUNNER_TEMP/native-assets"- test "$(find "$RUNNER_TEMP/native-assets" -type f | wc -l | tr -d ' ')" = "3"+ test "$(find "$RUNNER_TEMP/native-assets" -type f | wc -l | tr -d ' ')" = "9"gh release upload "$CURRENT_TAG" "$RUNNER_TEMP/native-assets/"* \--repo "$GITHUB_REPOSITORY" \--clobber@@ -140,8 +146,16 @@ jobs:))}}- name: macOS arm64- runs-on: macos-14+ name: macOS ${{ matrix.arch }}+ runs-on: ${{ matrix.runner }}+ strategy:+ fail-fast: false+ matrix:+ include:+ - arch: arm64+ runner: macos-15+ - arch: x64+ runner: macos-15-intelsteps:- name: Check out source@@ -159,7 +173,7 @@ jobs:uses: actions/cache@v5with:path: ~/.bun/install/cache- key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}+ key: ${{ runner.os }}-${{ matrix.arch }}-bun-${{ hashFiles('bun.lock') }}- name: Cache Rust dependencies and sidecar buildsuses: actions/cache@v5@@ -168,9 +182,9 @@ jobs:~/.cargo/registry~/.cargo/gitcrates/desktop-sidecar/target- key: ${{ runner.os }}-rust-${{ hashFiles('crates/desktop-sidecar/Cargo.lock', 'crates/desktop-sidecar/**/*.rs') }}+ key: ${{ runner.os }}-${{ matrix.arch }}-rust-${{ hashFiles('crates/desktop-sidecar/Cargo.lock', 'crates/desktop-sidecar/**/*.rs') }}restore-keys: |- ${{ runner.os }}-rust-+ ${{ runner.os }}-${{ matrix.arch }}-rust-- name: Cache Electron downloadsuses: actions/cache@v5@@ -178,7 +192,7 @@ jobs:path: |~/Library/Caches/electron~/Library/Caches/electron-builder- key: ${{ runner.os }}-electron-${{ hashFiles('bun.lock', 'apps/desktop/package.json') }}+ key: ${{ runner.os }}-${{ matrix.arch }}-electron-${{ hashFiles('bun.lock', 'apps/desktop/package.json') }}- name: Import macOS signing identityenv:@@ -273,35 +287,82 @@ jobs:echo "APPLE_API_ISSUER=$APPLE_API_ISSUER" >> "$GITHUB_ENV"- name: Package desktop installer+ env:+ EDGE_EVER_DESKTOP_ARCH: ${{ matrix.arch }}run: bun scripts/run-desktop-builder.mjs --publish never- name: Verify desktop installerenv:+ EDGE_EVER_DESKTOP_ARCH: ${{ matrix.arch }}EDGE_EVER_VERIFY_TARGET: darwinrun: bun scripts/verify-desktop-package.mjs+ - name: Stage architecture-specific desktop assets+ uses: actions/upload-artifact@v6+ with:+ name: edgeever-desktop-macOS-${{ matrix.arch }}-staging+ path: |+ release/desktop/EdgeEver-*-mac-${{ matrix.arch }}.dmg+ release/desktop/EdgeEver-*-mac-${{ matrix.arch }}.dmg.blockmap+ release/desktop/EdgeEver-*-mac-${{ matrix.arch }}.zip+ release/desktop/EdgeEver-*-mac-${{ matrix.arch }}.zip.blockmap+ if-no-files-found: error+ retention-days: 14++ desktop-assets:+ needs: [release-plan, desktop]+ if: >-+ ${{+ always() &&+ needs.desktop.result == 'success' &&+ (+ (github.event_name == 'workflow_dispatch' && inputs.release_tag == '') ||+ (+ github.event_name == 'workflow_dispatch' &&+ inputs.release_tag != '' &&+ needs.release-plan.result == 'success' &&+ needs.release-plan.outputs.asset_ready == 'false' &&+ needs.release-plan.outputs.rebuild == 'true'+ )+ )+ }}+ name: Finalize macOS release assets+ runs-on: ubuntu-latest+ steps:+ - name: Check out source+ uses: actions/checkout@v5++ - name: Download architecture-specific assets+ uses: actions/download-artifact@v7+ with:+ pattern: edgeever-desktop-macOS-*-staging+ path: release/desktop+ merge-multiple: true++ - name: Create and audit combined update metadata+ run: |+ version="$(node -p "JSON.parse(require('fs').readFileSync('apps/desktop/package.json', 'utf8')).version")"+ node scripts/create-mac-update-metadata.mjs release/desktop "$version"+ asset_ready="$(+ find release/desktop -maxdepth 1 -type f -exec basename {} \; |+ node scripts/check-native-release-assets.mjs desktop true "v${version}" "$version"+ )"+ test "$asset_ready" = "true"+- name: Upload verified desktop assets to Releaseif: github.event_name == 'workflow_dispatch' && inputs.release_tag != ''env:GH_TOKEN: ${{ github.token }}RELEASE_TAG: ${{ inputs.release_tag }}run: |- version="$(node -p "JSON.parse(require('fs').readFileSync('apps/desktop/package.json', 'utf8')).version")"- gh release upload "$RELEASE_TAG" \- "release/desktop/EdgeEver-${version}-mac-arm64.dmg" \- "release/desktop/EdgeEver-${version}-mac-arm64.dmg.blockmap" \- "release/desktop/latest-mac.yml" \+ gh release upload "$RELEASE_TAG" release/desktop/* \--repo "$GITHUB_REPOSITORY" \--clobber- - name: Upload desktop installer and metadata+ - name: Upload combined desktop installers and metadatauses: actions/upload-artifact@v6with:- name: edgeever-desktop-macOS-arm64- path: |- release/desktop/**/*.dmg- release/desktop/**/*.zip- release/desktop/**/*.blockmap- release/desktop/**/*.yml+ name: edgeever-desktop-macOS-arm64-x64+ path: release/desktop/*if-no-files-found: errorretention-days: 14diff --git a/AGENTS.md b/AGENTS.mdindex 66df2ba9..47cb3917 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -11,12 +11,12 @@## GitHub Release 约束与流程1. **版本号与基线**:使用 `vX.Y.Z` 格式(非 Draft/Prerelease)。递增根目录 `package.json`;若含移动端修改,同步更新 `apps/mobile/app.json` 的 `expo.version` 并递增 `android.versionCode`。上一个实际 Release 为审计基线。-2. **跨平台 Release 资产**:每个正式 Release 页面必须同时包含 macOS arm64 DMG 和 Android arm64 APK。若本次未修改对应原生运行时代码、依赖、配置或构建工具,直接复用上一个正式 Release 中已验证的原始资产,保留原文件名与校验和,禁止仅为匹配新版本号而重命名。+2. **跨平台 Release 资产**:每个正式 Release 页面必须同时包含 macOS arm64 DMG、macOS x64 DMG 和 Android arm64 APK。若本次未修改对应原生运行时代码、依赖、配置或构建工具,直接复用上一个正式 Release 中已验证的原始资产,保留原文件名与校验和,禁止仅为匹配新版本号而重命名。3. **验证命令**:必须通过 `bun run typecheck`、`bun run typecheck:mobile` 和 `bun run build:web`。4. **原生资产构建与复用**:由 `scripts/plan-native-release.mjs` 决定重建或复用;桌面资产包含 `apps/web`。修改判定规则时同步更新测试。移动端重建使用 `bun run build:android:apk:local`,签名配置保存在仓库外。5. **Draft 内准备资产**:通过带 `release_tag` 的 `workflow_dispatch` 在 Draft 中准备并验证资产;`published` 事件只审计,禁止重新构建或上传。6. **桌面验证职责**:桌面 Release 工作流负责测试、包结构检查、签名与公证;代理不再重复下载 Draft 或执行本地首次启动验收,除非用户明确要求。-7. **发布后安装**:正式发布后,从该 GitHub Release 下载最终 DMG,覆盖安装 `/Applications/EdgeEver.app` 并启动,保留用户数据。功能体验由用户在实际使用中验证。+7. **发布后安装**:正式发布后,从该 GitHub Release 下载与当前 Mac 架构匹配的最终 DMG,覆盖安装 `/Applications/EdgeEver.app` 并启动,保留用户数据。功能体验由用户在实际使用中验证。8. **失败处理**:工作流或资产审计失败时保持或恢复 Draft,修复后重跑;不得公开已知损坏的 Release。9. **Release 说明结构**:使用中英文双语格式(正文禁止包含字面量 `\n`)。功能/修复关联对应 Issue 并标记 Label,发布后回链并关闭 Issue。正文结构:diff --git a/README.md b/README.mdindex e4b7f1a4..026e68cc 100644--- a/README.md+++ b/README.md@@ -105,7 +105,7 @@ The Chrome/Edge web clipper is officially published. You can install it directlyThe Android app is now available on [Google Play](https://play.google.com/store/apps/details?id=org.edgeever.mobile), with signed APKs also available from [GitHub Releases](https://github.com/tianma-if/edgeever/releases). The iOS app has been submitted and is currently under App Store review.-The native desktop app is built with Electron and a Rust sidecar. Development and unsigned installer instructions are available in [`apps/desktop/README.md`](apps/desktop/README.md); signed release artifacts are produced by the desktop CI workflow.+The native desktop app is built with Electron and a Rust sidecar. GitHub Releases provide separate signed and notarized DMGs for Apple Silicon (`arm64`) and Intel (`x64`) Macs. Development and unsigned installer instructions are available in [`apps/desktop/README.md`](apps/desktop/README.md); signed release artifacts are produced by the desktop CI workflow.## Tech Stackdiff --git a/README.zh-CN.md b/README.zh-CN.mdindex aca90b0f..642cc1b3 100644--- a/README.zh-CN.md+++ b/README.zh-CN.md@@ -48,7 +48,7 @@ EdgeEver 是一款现代化的开源笔记工作区。它为你找回经典印- **高效多选与批量操作**:支持笔记批量合并、批量移动,以及笔记本拖拽排序与层级调整。- **离线草稿与同步队列**:网络不稳定时自动保存离线草稿,恢复连线后自动入队同步。- **多账号与个人空间隔离**:单实例支持创建多个独立账号,用户数据相互隔离,配备直观的管理员账号管理与安全加密机制。-- **全平台多端覆盖**:已上架 Chrome/Edge 网页裁剪插件;支持安装为 PWA 应用;原生 Android App 已上架 [Google Play](https://play.google.com/store/apps/details?id=org.edgeever.mobile),也可从 GitHub Releases 下载 APK;iOS App 当前仍在 App Store 审核中;原生桌面端计划基于 Electron + Rust Sidecar 构建。+- **全平台多端覆盖**:已上架 Chrome/Edge 网页裁剪插件;支持安装为 PWA 应用;原生 Android App 已上架 [Google Play](https://play.google.com/store/apps/details?id=org.edgeever.mobile),也可从 GitHub Releases 下载 APK;iOS App 当前仍在 App Store 审核中;原生桌面端基于 Electron + Rust Sidecar 构建。## 部署@@ -107,7 +107,7 @@ Chrome/Edge 网页裁剪插件已正式上架,您可以通过以下链接直Android App 现已上架 [Google Play](https://play.google.com/store/apps/details?id=org.edgeever.mobile),也可从 [GitHub Releases](https://github.com/tianma-if/edgeever/releases) 下载签名 APK。iOS App 已提交,目前仍在 App Store 审核中。-原生桌面端 App 计划基于 Electron + Rust Sidecar 构建。+原生桌面端 App 基于 Electron + Rust Sidecar 构建。GitHub Releases 分别为 Apple Silicon(`arm64`)和 Intel(`x64`)Mac 提供已签名并完成公证的 DMG。开发与未签名安装包构建方式详见 [`apps/desktop/README.md`](apps/desktop/README.md),正式签名资产由桌面端 CI 工作流生成。## 技术栈diff --git a/apps/desktop/README.md b/apps/desktop/README.mdindex 96e10ac3..32a9d3f5 100644--- a/apps/desktop/README.md+++ b/apps/desktop/README.md@@ -28,8 +28,10 @@ bun run build:desktop:sidecarCSC_IDENTITY_AUTO_DISCOVERY=false bun run --cwd apps/desktop dist -- --publish never```-The resulting DMG, NSIS installer, or AppImage is written under-`release/desktop`. The CI workflow accepts optional signing secrets:+The resulting DMG, ZIP updater package, NSIS installer, or AppImage is written+under `release/desktop`. Formal macOS Releases contain separate `arm64` and+`x64` DMGs; each package includes a Rust sidecar compiled for the same+architecture. The CI workflow accepts optional signing secrets:On macOS, users can double-click EdgeEver in the mounted DMG and choose**Install and Launch**. The app moves itself to `Applications`, relaunches the@@ -50,8 +52,9 @@ runs. When a GitHub Release is published, the workflow first compares it withthe previous formal Release. It rebuilds and publishes the installer throughelectron-builder only when Electron, the Rust sidecar, native dependencies,packaging configuration, or desktop build tooling changed. Web-only Releases-reuse the previous verified DMG, blockmap, and update metadata without renaming-them, so the macOS runner and signing pipeline are not scheduled unnecessarily.+reuse the previous verified arm64/x64 DMGs, updater ZIPs, blockmaps, and+combined update metadata without renaming them, so the macOS runners and+signing pipeline are not scheduled unnecessarily.The desktop Settings page exposes the sidecar's local backup list. Restoring abackup creates an additional protective backup first, restores the SQLitediff --git a/apps/desktop/electron-builder.yml b/apps/desktop/electron-builder.ymlindex 9db61d1a..d3d5292f 100644--- a/apps/desktop/electron-builder.yml+++ b/apps/desktop/electron-builder.yml@@ -42,8 +42,7 @@ mac:category: public.app-category.productivitytarget:- target: dmg- arch:- - arm64+ - target: zipartifactName: EdgeEver-${version}-mac-${arch}.${ext}dmg:title: "EdgeEver: double-click to install"diff --git a/apps/web/src/lib/version-check.test.mjs b/apps/web/src/lib/version-check.test.mjsindex bb6993c1..92a26389 100644--- a/apps/web/src/lib/version-check.test.mjs+++ b/apps/web/src/lib/version-check.test.mjs@@ -6,6 +6,8 @@ describe("platform release version checks", () => {expect(findDesktopReleaseVersion(["EdgeEver-1.6.50-mac-arm64.dmg","EdgeEver-1.6.50-mac-arm64.dmg.blockmap",+ "EdgeEver-1.6.50-mac-x64.dmg",+ "EdgeEver-1.6.50-mac-x64.dmg.blockmap","edgeever-android-v1.6.49-arm64-v8a.apk",])).toBe("1.6.50");});@@ -14,6 +16,9 @@ describe("platform release version checks", () => {expect(findDesktopReleaseVersion([])).toBeNull();expect(findDesktopReleaseVersion(["EdgeEver-1.6.49-mac-arm64.dmg",+ "EdgeEver-1.6.50-mac-x64.dmg",+ ])).toBeNull();+ expect(findDesktopReleaseVersion(["EdgeEver-1.6.50-mac-arm64.dmg",])).toBeNull();});diff --git a/apps/web/src/lib/version-check.ts b/apps/web/src/lib/version-check.tsindex df88829e..f6fca217 100644--- a/apps/web/src/lib/version-check.ts+++ b/apps/web/src/lib/version-check.ts@@ -8,13 +8,22 @@ export type LatestRelease = {url: string;};-const DESKTOP_ASSET_PATTERN = /^EdgeEver-(\d+\.\d+\.\d+)-mac-arm64\.dmg$/;+const DESKTOP_ASSET_PATTERN = /^EdgeEver-(\d+\.\d+\.\d+)-mac-(arm64|x64)\.dmg$/;export const findDesktopReleaseVersion = (assetNames: string[]) => {- const versions = assetNames- .map((name) => DESKTOP_ASSET_PATTERN.exec(name)?.[1])- .filter((version): version is string => Boolean(version));- return versions.length === 1 ? versions[0] : null;+ const versions = new Map<string, string>();+ for (const name of assetNames) {+ const match = DESKTOP_ASSET_PATTERN.exec(name);+ if (!match) continue;+ if (versions.has(match[2])) return null;+ versions.set(match[2], match[1]);+ }+ return (+ versions.size === 2 &&+ versions.get("arm64") === versions.get("x64")+ )+ ? versions.get("arm64")!+ : null;};const parseVersion = (value: string) => {@@ -78,7 +87,7 @@ export const fetchLatestRelease = async (signal?: AbortSignal): Promise<LatestRe);const isDesktop = Boolean(window.edgeeverDesktop?.isAvailable);if (isDesktop && !desktopVersion) {- throw new Error("Release response does not contain exactly one desktop DMG");+ throw new Error("Release response does not contain matching arm64 and x64 desktop DMGs");}const release = {tagName: payload.tag_name,diff --git a/docs/release.md b/docs/release.mdindex 36bb25f5..ff173ee9 100644--- a/docs/release.md+++ b/docs/release.md@@ -3,7 +3,7 @@EdgeEver releases are prepared with a single local command. The command validatesthe repository, creates the tracking Issue, updates versions, prepares and auditsnative assets in a Draft Release, publishes the Release, and installs the final-macOS DMG.+macOS DMG matching the maintainer's Mac architecture.This process does not perform mobile store delivery. Google Play and App StoreConnect delivery is a separate, explicit operation documented in@@ -65,11 +65,13 @@ marketing versions change only when that native runtime is rebuilt. Android`versionCode` and iOS build numbers remain independent, monotonically increasingstore build identifiers.-When a verified DMG or APK is reused, its original filename and native version-remain unchanged. Desktop and Android update checks derive the latest applicable-version from their corresponding Release asset instead of comparing against the-overall GitHub tag. This prevents an unchanged native client from repeatedly-offering an update for a Web-only or API-only Release.+When verified DMGs or an APK are reused, their original filenames and native+versions remain unchanged. Every formal Release contains separate macOS arm64+and x64 DMGs plus architecture-specific updater ZIPs. Desktop and Android update+checks derive the latest applicable version from their corresponding Release+asset instead of comparing against the overall GitHub tag. This prevents an+unchanged native client from repeatedly offering an update for a Web-only or+API-only Release.## Automated Flow@@ -83,14 +85,17 @@ offering an update for a Web-only or API-only Release.updated.4. Create a bilingual tracking Issue, commit the version changes to `main`, push,and create a Draft Release with bilingual notes.-5. Dispatch the desktop and Android asset workflows concurrently, wait for both,- and verify filenames, sizes, and checksums before publication.+5. Dispatch the desktop and Android asset workflows concurrently. The desktop+ workflow builds arm64 and x64 packages on matching native runners, then+ combines their update metadata. Verify filenames, sizes, and checksums before+ publication.6. Publish the Release and wait only for the required desktop and Androidpost-publication audits.7. Print the Demo deployment run or workflow URL. Demo deployment continues inthe background and does not delay release completion.-8. Link and close the tracking Issue, download the final DMG, verify its checksum- and signature, replace `/Applications/EdgeEver.app`, and launch it.+8. Link and close the tracking Issue, download the final DMG matching the+ maintainer Mac's architecture, verify its checksum and signature, replace+ `/Applications/EdgeEver.app`, and launch it.No Release step builds a Play AAB, starts an EAS iOS build, or uploads to amobile store.diff --git a/docs/release.zh-CN.md b/docs/release.zh-CN.mdindex 19026c4c..e48b84ec 100644--- a/docs/release.zh-CN.md+++ b/docs/release.zh-CN.md@@ -1,8 +1,8 @@# Release 发布指南EdgeEver 使用一条本地命令准备 Release。该命令会检查仓库、创建跟踪 Issue、-更新版本、在 Draft Release 中准备并审计原生资产、正式发布 Release,并安装最终-的 macOS DMG。+更新版本、在 Draft Release 中准备并审计原生资产、正式发布 Release,并安装与+维护者 Mac 架构匹配的最终 macOS DMG。该流程不执行移动端商店交付。Google Play 和 App Store Connect 交付是独立且需要显式触发的操作,详见[移动端商店交付](store-delivery.zh-CN.md)。@@ -54,9 +54,11 @@ GitHub 状态。`--skip-install` 会跳过发布后的 DMG 安装,仅适用于对应的原生展示版本。Android `versionCode` 和 iOS Build Number 继续作为独立、严格递增的商店构建标识。-复用已验证的 DMG 或 APK 时,保留其原始文件名和原生版本。桌面端和 Android-更新检查从各自在 Release 中的资产读取适用版本,而不是直接比较整体 GitHub-tag,避免原生客户端因为仅涉及 Web 或 API 的 Release 反复提示无效更新。+复用已验证的 DMG 或 APK 时,保留其原始文件名和原生版本。每个正式 Release+都同时包含独立的 macOS arm64 与 x64 DMG,以及按架构区分的更新 ZIP。桌面端+和 Android 更新检查从各自在 Release 中的资产读取适用版本,而不是直接比较+整体 GitHub tag,避免原生客户端因为仅涉及 Web 或 API 的 Release 反复提示+无效更新。## 自动化流程@@ -68,13 +70,14 @@ tag,避免原生客户端因为仅涉及 Web 或 API 的 Release 反复提示可以复用,并且只更新受影响原生端的版本。4. 创建双语跟踪 Issue,将版本变更提交并推送到 `main`,然后创建带双语说明的Draft Release。-5. 并行触发桌面端和 Android 资产工作流,等待两者完成,并在正式发布前检查- 文件名、大小和校验和。+5. 并行触发桌面端和 Android 资产工作流。桌面端工作流分别在匹配的原生 Runner+ 上构建 arm64 与 x64 包,再合并自动更新元数据;正式发布前检查文件名、大小+ 和校验和。6. 正式发布 Release,且只等待必要的桌面端和 Android 发布后资产审计。7. 输出 Demo 部署任务或工作流链接。Demo 在后台继续部署,不再延迟 Release完成。-8. 回链并关闭跟踪 Issue,下载最终 DMG,验证校验和与签名,覆盖- `/Applications/EdgeEver.app` 并启动。+8. 回链并关闭跟踪 Issue,下载与维护者 Mac 架构匹配的最终 DMG,验证校验和与+ 签名,覆盖 `/Applications/EdgeEver.app` 并启动。Release 流程不会构建 Play AAB、启动 EAS iOS Build,也不会上传到移动端商店。diff --git a/package.json b/package.jsonindex 361f0140..029c74d3 100644--- a/package.json+++ b/package.json@@ -34,7 +34,7 @@"build:desktop": "EDGE_EVER_DESKTOP_BUILD=1 bun run build:web && bun run build:desktop:sidecar && bun run --cwd apps/desktop dist","benchmark:desktop:sidecar": "bun scripts/benchmark-desktop-sidecar.mjs","verify:web-performance": "bun scripts/verify-web-performance.mjs",- "test:release-planning": "bun test scripts/plan-native-release.test.mjs scripts/check-native-release-assets.test.mjs scripts/release.test.mjs scripts/validate-store-delivery.test.mjs scripts/store-delivery.test.mjs apps/web/src/lib/version-check.test.mjs apps/mobile/src/lib/mobile-release.test.ts",+ "test:release-planning": "bun test scripts/plan-native-release.test.mjs scripts/check-native-release-assets.test.mjs scripts/create-mac-update-metadata.test.mjs scripts/release.test.mjs scripts/validate-store-delivery.test.mjs scripts/store-delivery.test.mjs apps/web/src/lib/version-check.test.mjs apps/mobile/src/lib/mobile-release.test.ts","release": "bun scripts/release.mjs","publish:stores": "bun scripts/store-delivery.mjs","test:desktop:sidecar": "bun scripts/test-desktop-sidecar.mjs",diff --git a/scripts/check-native-release-assets.mjs b/scripts/check-native-release-assets.mjsindex 91cebd17..5b940346 100644--- a/scripts/check-native-release-assets.mjs+++ b/scripts/check-native-release-assets.mjs@@ -21,23 +21,36 @@ export const nativeReleaseAssetsReady = ({}if (platform === "desktop") {- const dmgNames = assetNames.filter((name) =>- /^EdgeEver-.*-mac-arm64\.dmg$/.test(name),- );- const blockmapNames = assetNames.filter((name) =>- /^EdgeEver-.*-mac-arm64\.dmg\.blockmap$/.test(name),- );- if (- dmgNames.length !== 1 ||- blockmapNames.length !== 1 ||- assetNames.filter((name) => name === "latest-mac.yml").length !== 1 ||- blockmapNames[0] !== `${dmgNames[0]}.blockmap`- ) {- return false;+ const versions = new Set();+ for (const arch of ["arm64", "x64"]) {+ const dmgNames = assetNames.filter((name) =>+ new RegExp(`^EdgeEver-(.+)-mac-${arch}\\.dmg$`).test(name)+ );+ const zipNames = assetNames.filter((name) =>+ new RegExp(`^EdgeEver-(.+)-mac-${arch}\\.zip$`).test(name)+ );+ if (dmgNames.length !== 1 || zipNames.length !== 1) return false;+ const prefix = dmgNames[0].replace(/\.dmg$/, "");+ if (zipNames[0] !== `${prefix}.zip`) return false;+ const version = new RegExp(`^EdgeEver-(.+)-mac-${arch}\\.dmg$`)+ .exec(dmgNames[0])?.[1];+ if (!version) return false;+ versions.add(version);+ for (const name of [+ `${prefix}.dmg`,+ `${prefix}.dmg.blockmap`,+ `${prefix}.zip`,+ `${prefix}.zip.blockmap`,+ ]) {+ if (assetNames.filter((assetName) => assetName === name).length !== 1) {+ return false;+ }+ }}return (- !rebuild ||- dmgNames[0] === `EdgeEver-${desktopVersion}-mac-arm64.dmg`+ versions.size === 1 &&+ (!rebuild || versions.has(desktopVersion)) &&+ assetNames.filter((name) => name === "latest-mac.yml").length === 1);}diff --git a/scripts/check-native-release-assets.test.mjs b/scripts/check-native-release-assets.test.mjsindex a89acb8b..5257f9e3 100644--- a/scripts/check-native-release-assets.test.mjs+++ b/scripts/check-native-release-assets.test.mjs@@ -46,6 +46,12 @@ describe("native release asset readiness", () => {assetNames: ["EdgeEver-1.6.33-mac-arm64.dmg","EdgeEver-1.6.33-mac-arm64.dmg.blockmap",+ "EdgeEver-1.6.33-mac-arm64.zip",+ "EdgeEver-1.6.33-mac-arm64.zip.blockmap",+ "EdgeEver-1.6.33-mac-x64.dmg",+ "EdgeEver-1.6.33-mac-x64.dmg.blockmap",+ "EdgeEver-1.6.33-mac-x64.zip",+ "EdgeEver-1.6.33-mac-x64.zip.blockmap","latest-mac.yml",],}),@@ -56,6 +62,12 @@ describe("native release asset readiness", () => {const current = ["EdgeEver-1.6.35-mac-arm64.dmg","EdgeEver-1.6.35-mac-arm64.dmg.blockmap",+ "EdgeEver-1.6.35-mac-arm64.zip",+ "EdgeEver-1.6.35-mac-arm64.zip.blockmap",+ "EdgeEver-1.6.35-mac-x64.dmg",+ "EdgeEver-1.6.35-mac-x64.dmg.blockmap",+ "EdgeEver-1.6.35-mac-x64.zip",+ "EdgeEver-1.6.35-mac-x64.zip.blockmap","latest-mac.yml",];expect(@@ -73,7 +85,25 @@ describe("native release asset readiness", () => {rebuild: true,currentTag: "v1.6.35",desktopVersion: "1.6.35",- assetNames: current.slice(0, 2),+ assetNames: current.slice(0, 8),+ }),+ ).toBe(false);+ });++ test("rejects a desktop set with one architecture missing", () => {+ expect(+ nativeReleaseAssetsReady({+ platform: "desktop",+ rebuild: false,+ currentTag: "v1.6.35",+ desktopVersion: "1.6.35",+ assetNames: [+ "EdgeEver-1.6.33-mac-arm64.dmg",+ "EdgeEver-1.6.33-mac-arm64.dmg.blockmap",+ "EdgeEver-1.6.33-mac-arm64.zip",+ "EdgeEver-1.6.33-mac-arm64.zip.blockmap",+ "latest-mac.yml",+ ],}),).toBe(false);});diff --git a/scripts/create-mac-update-metadata.mjs b/scripts/create-mac-update-metadata.mjsnew file mode 100644index 00000000..ca362e3a--- /dev/null+++ b/scripts/create-mac-update-metadata.mjs@@ -0,0 +1,64 @@+import assert from "node:assert/strict";+import { createHash } from "node:crypto";+import { readFileSync, statSync, writeFileSync } from "node:fs";+import { join, resolve } from "node:path";+import { fileURLToPath } from "node:url";++const MAC_ARCHES = ["arm64", "x64"];++const sha512File = (path) =>+ createHash("sha512").update(readFileSync(path)).digest("base64");++export const buildMacUpdateMetadata = ({+ version,+ outputDirectory,+ releaseDate = new Date().toISOString(),+}) => {+ assert.match(version, /^\d+\.\d+\.\d+$/, `Invalid desktop version: ${version}`);+ const files = MAC_ARCHES.map((arch) => {+ const url = `EdgeEver-${version}-mac-${arch}.zip`;+ const path = join(outputDirectory, url);+ return {+ url,+ sha512: sha512File(path),+ size: statSync(path).size,+ };+ });+ const primary = files[0];+ const lines = [+ `version: ${version}`,+ "files:",+ ...files.flatMap((file) => [+ ` - url: ${file.url}`,+ ` sha512: ${file.sha512}`,+ ` size: ${file.size}`,+ ]),+ `path: ${primary.url}`,+ `sha512: ${primary.sha512}`,+ `releaseDate: '${releaseDate}'`,+ "",+ ];+ return lines.join("\n");+};++const run = () => {+ const [outputDirectoryValue, version] = process.argv.slice(2);+ if (!outputDirectoryValue || !version) {+ console.error(+ "Usage: node scripts/create-mac-update-metadata.mjs <output-directory> <version>",+ );+ process.exit(1);+ }+ const outputDirectory = resolve(outputDirectoryValue);+ writeFileSync(+ join(outputDirectory, "latest-mac.yml"),+ buildMacUpdateMetadata({ version, outputDirectory }),+ );+};++if (+ process.argv[1] &&+ resolve(process.argv[1]) === fileURLToPath(import.meta.url)+) {+ run();+}diff --git a/scripts/create-mac-update-metadata.test.mjs b/scripts/create-mac-update-metadata.test.mjsnew file mode 100644index 00000000..dcc1ec4b--- /dev/null+++ b/scripts/create-mac-update-metadata.test.mjs@@ -0,0 +1,24 @@+import { mkdtempSync, writeFileSync } from "node:fs";+import { tmpdir } from "node:os";+import { join } from "node:path";+import { describe, expect, test } from "bun:test";+import { buildMacUpdateMetadata } from "./create-mac-update-metadata.mjs";++describe("macOS update metadata", () => {+ test("lists architecture-specific ZIPs so the updater can select the matching Mac", () => {+ const outputDirectory = mkdtempSync(join(tmpdir(), "edgeever-update-metadata-"));+ writeFileSync(join(outputDirectory, "EdgeEver-1.7.0-mac-arm64.zip"), "arm");+ writeFileSync(join(outputDirectory, "EdgeEver-1.7.0-mac-x64.zip"), "intel");++ const metadata = buildMacUpdateMetadata({+ version: "1.7.0",+ outputDirectory,+ releaseDate: "2026-07-30T00:00:00.000Z",+ });++ expect(metadata).toContain("EdgeEver-1.7.0-mac-arm64.zip");+ expect(metadata).toContain("EdgeEver-1.7.0-mac-x64.zip");+ expect(metadata).toContain("releaseDate: '2026-07-30T00:00:00.000Z'");+ expect(metadata.match(/sha512:/g)).toHaveLength(3);+ });+});diff --git a/scripts/plan-native-release.mjs b/scripts/plan-native-release.mjsindex 63138fd8..74db360a 100644--- a/scripts/plan-native-release.mjs+++ b/scripts/plan-native-release.mjs@@ -26,7 +26,9 @@ export const planNativeRelease = (platform, changedFiles) => {platform === "mobile"? new Set(["bun.lock", "scripts/build-android-local.sh"]): new Set([+ ".github/workflows/desktop-build.yml","bun.lock",+ "scripts/create-mac-update-metadata.mjs","scripts/run-desktop-builder.mjs","scripts/verify-desktop-package.mjs",]);diff --git a/scripts/plan-native-release.test.mjs b/scripts/plan-native-release.test.mjsindex 58aee605..b12ca06d 100644--- a/scripts/plan-native-release.test.mjs+++ b/scripts/plan-native-release.test.mjs@@ -38,6 +38,18 @@ describe("native release planning", () => {});});+ test("rebuilds desktop when its architecture packaging pipeline changes", () => {+ const changedFiles = [+ ".github/workflows/desktop-build.yml",+ "scripts/create-mac-update-metadata.mjs",+ "scripts/run-desktop-builder.mjs",+ ];+ expect(planNativeRelease("desktop", changedFiles)).toEqual({+ rebuild: true,+ relevantChanges: changedFiles,+ });+ });+test("does not rebuild desktop for release notes or a root version bump alone", () => {expect(planNativeRelease("desktop", ["package.json", "AGENTS.md"]),diff --git a/scripts/release.mjs b/scripts/release.mjsindex 88dd2740..3478d530 100644--- a/scripts/release.mjs+++ b/scripts/release.mjs@@ -173,7 +173,7 @@ export const buildIssueBody = ({ changesEn, changesZh }) => ["## Acceptance criteria","","- Required type checks, Web build, and native release planning tests pass.",- "- The Draft Release contains an audited macOS arm64 DMG and Android arm64 APK.",+ "- The Draft Release contains audited macOS arm64 and x64 DMGs and an Android arm64 APK.","- Post-publication native asset audits pass.",].join("\n");@@ -200,7 +200,7 @@ export const buildReleaseNotes = ({"- Native release planning and asset audit tests.",`- Version bump: \`${bump}\`.`,desktopRebuild- ? "- Desktop release plan: rebuild, sign, notarize, and verify a new macOS arm64 DMG."+ ? "- Desktop release plan: rebuild, sign, notarize, and verify new macOS arm64 and x64 DMGs.": `- Desktop release plan: reuse the verified assets from ${previousTag} with their original filenames and checksums.`,mobileRebuild? "- Android release plan: rebuild and verify a signed arm64 APK."@@ -222,7 +222,7 @@ export const buildReleaseNotes = ({"- 原生 Release 规划与资产审计测试。",`- 版本递增级别:\`${bump}\`。`,desktopRebuild- ? "- 桌面端 Release 计划:重新构建、签名、公证并验证新的 macOS arm64 DMG。"+ ? "- 桌面端 Release 计划:重新构建、签名、公证并验证新的 macOS arm64 与 x64 DMG。": `- 桌面端 Release 计划:复用 ${previousTag} 已验证资产,并保留原始文件名与校验和。`,mobileRebuild? "- Android Release 计划:重新构建并验证签名 arm64 APK。"@@ -242,14 +242,17 @@ export const reusedAssetMatches = (previousAssets, currentAssets, name) => {);};-export const selectPublishedDmg = (assets) => {+export const selectPublishedDmg = (assets, arch = process.arch) => {+ if (!["arm64", "x64"].includes(arch)) {+ throw new Error(`Unsupported macOS architecture for installation: ${arch}.`);+ }const matches = assets.filter((asset) =>- /^EdgeEver-(.+)-mac-arm64\.dmg$/.test(asset.name)+ new RegExp(`^EdgeEver-(.+)-mac-${arch}\\.dmg$`).test(asset.name));if (matches.length !== 1) {- throw new Error(`Expected exactly one macOS arm64 DMG, found ${matches.length}.`);+ throw new Error(`Expected exactly one macOS ${arch} DMG, found ${matches.length}.`);}- const version = /^EdgeEver-(.+)-mac-arm64\.dmg$/.exec(matches[0].name)?.[1];+ const version = new RegExp(`^EdgeEver-(.+)-mac-${arch}\\.dmg$`).exec(matches[0].name)?.[1];if (!version || !matches[0].digest?.startsWith("sha256:")) {throw new Error("Published DMG is missing its version or SHA-256 digest.");}@@ -517,11 +520,11 @@ const assertDraftAssets = ({const previousDesktopNames = previousAssets.map((asset) => asset.name).filter((name) =>- /^EdgeEver-.*-mac-arm64\.dmg(?:\.blockmap)?$/.test(name) ||+ /^EdgeEver-.*-mac-(?:arm64|x64)\.(?:dmg|zip)(?:\.blockmap)?$/.test(name) ||name === "latest-mac.yml");if (- previousDesktopNames.length !== 3 ||+ previousDesktopNames.length !== 9 ||!previousDesktopNames.every((name) =>reusedAssetMatches(previousAssets, assets, name))diff --git a/scripts/release.test.mjs b/scripts/release.test.mjsindex d1c3d7cd..9332e3d3 100644--- a/scripts/release.test.mjs+++ b/scripts/release.test.mjs@@ -108,23 +108,28 @@ describe("release automation", () => {).toBe(false);});- test("selects a reused DMG and derives its native version", () => {+ test("selects the DMG matching the current Mac architecture", () => {+ const assets = [+ {+ name: "EdgeEver-1.6.51-mac-arm64.dmg",+ size: 10,+ digest: "sha256:abc",+ },+ {+ name: "EdgeEver-1.6.51-mac-x64.dmg",+ size: 11,+ digest: "sha256:def",+ },+ ];expect(- selectPublishedDmg([- {- name: "EdgeEver-1.6.51-mac-arm64.dmg",- size: 10,- digest: "sha256:abc",- },- {- name: "edgeever-android-v1.6.51-arm64-v8a.apk",- size: 10,- digest: "sha256:def",- },- ]),+ selectPublishedDmg(assets, "arm64"),).toMatchObject({asset: { name: "EdgeEver-1.6.51-mac-arm64.dmg" },version: "1.6.51",});+ expect(selectPublishedDmg(assets, "x64")).toMatchObject({+ asset: { name: "EdgeEver-1.6.51-mac-x64.dmg" },+ version: "1.6.51",+ });});});diff --git a/scripts/run-desktop-builder.mjs b/scripts/run-desktop-builder.mjsindex cfd2b7c2..650dc17b 100644--- a/scripts/run-desktop-builder.mjs+++ b/scripts/run-desktop-builder.mjs@@ -3,6 +3,11 @@ import { spawnSync } from "node:child_process";const publishIndex = process.argv.indexOf("--publish");const publishMode = publishIndex >= 0 ? process.argv[publishIndex + 1] ?? "never" : "never";const environment = { ...process.env };+const requestedArch = environment.EDGE_EVER_DESKTOP_ARCH;++if (requestedArch && !["arm64", "x64"].includes(requestedArch)) {+ throw new Error(`EDGE_EVER_DESKTOP_ARCH must be arm64 or x64, received: ${requestedArch}`);+}// electron-builder treats an explicitly present empty CSC_LINK/WIN_CSC_LINK// as a path. Remove empty optional signing variables so unsigned CI builds@@ -20,7 +25,7 @@ for (const key of [}environment.CSC_IDENTITY_AUTO_DISCOVERY ||= "false";-const result = spawnSync(process.execPath, [+const builderArgs = ["run","--cwd","apps/desktop",@@ -28,7 +33,15 @@ const result = spawnSync(process.execPath, ["--","--publish",publishMode,-], { env: environment, stdio: "inherit" });+];+if (requestedArch) {+ builderArgs.push("--mac", `--${requestedArch}`);+}++const result = spawnSync(process.execPath, builderArgs, {+ env: environment,+ stdio: "inherit",+});if (result.error) throw result.error;process.exit(result.status ?? 1);diff --git a/scripts/verify-desktop-package.mjs b/scripts/verify-desktop-package.mjsindex c65183ea..4ac0fb9d 100644--- a/scripts/verify-desktop-package.mjs+++ b/scripts/verify-desktop-package.mjs@@ -1,10 +1,13 @@import assert from "node:assert/strict";+import { spawnSync } from "node:child_process";import { existsSync, readFileSync, readdirSync, rmSync, statSync } from "node:fs";import { basename, join } from "node:path";import { listPackage } from "@electron/asar";const outputDirectory = join(process.cwd(), "release", "desktop");-const version = JSON.parse(readFileSync(join(process.cwd(), "package.json"), "utf8")).version;+const version = JSON.parse(+ readFileSync(join(process.cwd(), "apps", "desktop", "package.json"), "utf8"),+).version;const walk = (directory) => {if (!existsSync(directory)) return [];@@ -20,6 +23,13 @@ const walk = (directory) => {const files = walk(outputDirectory);const matchingPrefix = (prefix) => files.filter((path) => basename(path).startsWith(prefix));const requestedPlatform = process.env.EDGE_EVER_VERIFY_TARGET ?? process.platform;+const requestedArch = process.env.EDGE_EVER_DESKTOP_ARCH ?? process.arch;++const verifyMachOArch = (path, arch, label) => {+ const result = spawnSync("lipo", ["-archs", path], { encoding: "utf8" });+ assert.equal(result.status, 0, `${label} architecture inspection failed: ${result.stderr || result.stdout}`);+ assert.deepEqual(result.stdout.trim().split(/\s+/), [arch], `${label} must contain only ${arch}`);+};for (const sidecarPath of files.filter((path) => /[\\/]resources[\\/]sidecar[\\/]edgeever-sidecar(?:\.exe)?$/i.test(path))) {const bundleRoot = sidecarPath.replace(/[\\/]resources[\\/]sidecar[\\/]edgeever-sidecar(?:\.exe)?$/i, "");@@ -28,12 +38,19 @@ for (const sidecarPath of files.filter((path) => /[\\/]resources[\\/]sidecar[\\/}if (requestedPlatform === "darwin") {- assert.ok(existsSync(join(outputDirectory, `EdgeEver-${version}-mac-arm64.dmg`)), "macOS package must contain the current arm64 DMG");- const unpackedApp = join(outputDirectory, "mac-arm64", "EdgeEver.app");+ assert.ok(["arm64", "x64"].includes(requestedArch), `Unsupported macOS architecture: ${requestedArch}`);+ assert.ok(existsSync(join(outputDirectory, `EdgeEver-${version}-mac-${requestedArch}.dmg`)), `macOS package must contain the current ${requestedArch} DMG`);+ assert.ok(existsSync(join(outputDirectory, `EdgeEver-${version}-mac-${requestedArch}.dmg.blockmap`)), `macOS package must contain the current ${requestedArch} DMG blockmap`);+ assert.ok(existsSync(join(outputDirectory, `EdgeEver-${version}-mac-${requestedArch}.zip`)), `macOS package must contain the current ${requestedArch} update ZIP`);+ assert.ok(existsSync(join(outputDirectory, `EdgeEver-${version}-mac-${requestedArch}.zip.blockmap`)), `macOS package must contain the current ${requestedArch} ZIP blockmap`);+ const unpackedApp = join(outputDirectory, `mac-${requestedArch}`, "EdgeEver.app");assert.ok(existsSync(unpackedApp), "macOS package must contain the unpacked app bundle");+ const executable = join(unpackedApp, "Contents", "MacOS", "EdgeEver");const appResources = join(unpackedApp, "Contents", "Resources");const sidecar = join(appResources, "sidecar", "edgeever-sidecar");assert.ok(existsSync(sidecar), `macOS app bundle is missing the sidecar: ${sidecar}`);+ verifyMachOArch(executable, requestedArch, "Electron executable");+ verifyMachOArch(sidecar, requestedArch, "Rust sidecar");const asarPath = join(appResources, "app.asar");assert.ok(existsSync(asarPath), `macOS app bundle is missing app.asar: ${asarPath}`);const asarFiles = new Set(listPackage(asarPath));