Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 推送语义化版本 tag(如 v0.1.3)时:
# 1) 与原先一致:在 ubuntu 上由 softprops 创建/更新 GitHub Release 并 generate_release_notes(PR 合并后再打 tag 的流程不变)。
# 2) tauri build(当前长期仅 macOS Apple Silicon / aarch64,节省 CI),向同一 Release 上传安装包与 latest.json(供应用内 updater)。
# 2) tauri build(macOS:aarch64 + x86_64,无 Windows,省 CI);latest.json 需含 Intel Mac 所用 darwin-x86_64,否则检查更新会报 platforms 缺失。
# 依赖 Secrets:TAURI_SIGNING_PRIVATE_KEY(必填);TAURI_SIGNING_PRIVATE_KEY_PASSWORD(可选)。
name: Release

Expand Down Expand Up @@ -34,17 +34,20 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# ── 打 tag 后:构建并上传到上述 Release(矩阵见下,仅 aarch64 时可再增 x86_64 / windows)──
# ── 打 tag 后:构建并上传到上述 Release(双架构 macOS;不跑 Windows 以省 CI)──
publish-tauri:
if: github.event_name == 'push'
needs: github-release
strategy:
fail-fast: false
matrix:
include:
# 长期仅 Apple Silicon:省 runner 时间;latest.json 仅含 darwin-aarch64 等当前产物
# Apple Silicon:应用内更新主路径
- platform: macos-latest
args: --target aarch64-apple-darwin
# Intel Mac / Rosetta x86:与上共存于 latest.json,缺则报 darwin-x86_64 not in platforms
- platform: macos-latest
args: --target x86_64-apple-darwin

runs-on: ${{ matrix.platform }}
timeout-minutes: 45
Expand Down Expand Up @@ -79,11 +82,11 @@ jobs:
if: matrix.platform != 'macos-latest'
uses: dtolnay/rust-toolchain@stable

- name: Install Rust stable (macOS aarch64)
- name: Install Rust stable (macOS aarch64 + x86_64)
if: matrix.platform == 'macos-latest'
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin
targets: aarch64-apple-darwin,x86_64-apple-darwin

- name: Build and upload to GitHub Release
uses: tauri-apps/tauri-action@v0
Expand Down
8 changes: 7 additions & 1 deletion docs/桌面应用-Release与自动更新.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
1. 在 `apps/desktop/package.json`、`apps/desktop/src-tauri/Cargo.toml`、`apps/desktop/src-tauri/tauri.conf.json` 中将 `version` 与即将推送的 tag 对齐(tag 为 `v0.1.4` 时版本号应为 `0.1.4`)。
2. 确保 `bun run sync:changelog` 后 `apps/desktop/src/data/app-changelog.md` 已提交(与 CI 校验一致)。
3. 推送 tag:`git tag v0.1.4 && git push origin v0.1.4`。
4. GitHub Actions 工作流 **Release**(见 `.github/workflows/release.yml`)会为 macOS(aarch64 / x86_64)与 Windows 构建安装包,并上传 `latest.json` 与各平台签名产物。
4. GitHub Actions 工作流 **Release**(见 `.github/workflows/release.yml`)在 **macOS** runner 上交叉构建 **aarch64 与 x86_64**(不设 Windows 矩阵时可不上传 Windows 安装包);需成功上传各目标产物,**`latest.json` 才会包含对应 `platforms` 键**,否则部分机型「检查更新」会失败。

应用内「检查更新」使用 `tauri-plugin-updater`,从以下地址拉取静态清单:

Expand Down Expand Up @@ -59,6 +59,12 @@ export TAURI_SIGNING_PRIVATE_KEY="$(cat xunji.updater.key)"
env -u CI bun run tauri build
```

## 常见问题

### 检查更新失败:`darwin-x86_64` 不在 `platforms` 里

仅发布 **aarch64** 包时,`latest.json` 往往只有 `darwin-aarch64`。**Intel Mac** 或 **Rosetta 下的 x86 应用** 会查找 `darwin-x86_64`,若 Release 未构建该目标,会报 *None of the fallback platforms … were found in the response*。请在 `release.yml` 的 `publish-tauri` 矩阵中保留 `x86_64-apple-darwin` 并成功上传;发新 tag 后再试「检查更新」。

## 端到端验证(两连续 tag)

1. 安装旧版本打包产物(或本地 `tauri build` 的上一版)。
Expand Down
Loading