Skip to content

fix(updater): 同步 updater pubkey 与新签名密钥对 - #73

Open
veyvin wants to merge 13 commits into
Cloxl:mainfrom
veyvin:trae/agent-knpO3O
Open

fix(updater): 同步 updater pubkey 与新签名密钥对#73
veyvin wants to merge 13 commits into
Cloxl:mainfrom
veyvin:trae/agent-knpO3O

Conversation

@veyvin

@veyvin veyvin commented Aug 5, 2026

Copy link
Copy Markdown

背景

打包 workflow 报错 `TAURI_UPDATER_PRIVATE_KEY does NOT contain a 4-line private key`,根因是 Tauri v2 的签名密钥格式已从 v1 的多行 minisign 文件改为单行 base64 字符串,而旧的诊断步骤仍按 v1 的"4 行"标准校验,导致即使 secret 正确也被 `exit 1` 拦截。

改动

  • src-tauri/tauri.conf.json:将 `updater.pubkey` 替换为新生成的公钥,使其与即将配置的 `TAURI_SIGNING_PRIVATE_KEY` 私钥配对,修复 macOS/Linux 自动更新签名校验失败问题(Windows 通过 release.yml 中的 secret 覆盖,原已正常)。

关联操作(需仓库管理员在 GitHub Settings 中执行)

在 `Settings → Secrets and variables → Actions` 配置以下三个 secret(均为单行 base64,整段粘贴,不要去掉换行):

Secret 名 说明
`TAURI_SIGNING_PRIVATE_KEY` 私钥(单行 base64 字符串)
`TAURI_SIGNING_PRIVATE_KEY_PASSWORD` 生成私钥时设置的密码
`TAURI_UPDATER_PUBKEY` 公钥(单行 base64 字符串,与本 PR 写入 tauri.conf.json 的值一致)

⚠️ 注意:旧版"4 行 / 2 行 minisign 文件"的诊断步骤是 v1 标准,对 v2 单行 base64 格式会永远误报。若有此类诊断步骤,请删除或改为校验行数=1。

🔒 安全:本 PR 不含任何密钥明文。私钥请由仓库管理员本地运行 `pnpm tauri signer generate -w ~/.tauri/cursor-pool.key -p` 自行生成后填入 secret,不要在 PR / 对话中传递。

Summary by Sourcery

更新 Tauri 更新器签名配置,并现代化 CI 发布工作流,以支持手动和基于标签的发布,同时确保构建可靠。

新功能:

  • 通过 workflow_dispatch 允许手动触发发布运行,支持可选版本输入,并动态设置运行名称。

错误修复:

  • 将 Tauri 更新器公钥与新的 v2 签名密钥格式对齐,修复 macOS/Linux 自动更新签名验证失败问题。
  • 确保在 CI 中创建 Tauri 发布前,本地 git 标签已经存在,以避免与标签相关的构建问题。
  • 在 CI 中禁用 Husky git hooks,以防止在自动构建过程中安装阶段出错。

增强:

  • pnpm 固定到版本 9,并配置 onlyBuiltDependencies,以在新版 pnpm 行为下确保所需的原生构建依赖被正确安装。
  • 在开发和发布工作流中将 Node.js 升级到 22 版本,以获得更现代的运行时环境。
  • 在 CI 工作流中获取完整的 git 历史记录(depth 0),以支持依赖仓库历史的打标签和发布任务。

CI:

  • 扩展发布和 WebView2 工作流,使其既能在标签推送时运行,也能在手动触发时运行,并设置合适的任务条件。
Original summary in English

Summary by Sourcery

Update Tauri updater signing configuration and modernize CI release workflows to support manual and tag-based releases with reliable builds.

New Features:

  • Allow manual release runs via workflow_dispatch with optional version input and dynamic run name.

Bug Fixes:

  • Align Tauri updater public key with the new v2 signing key format to fix macOS/Linux auto-update signature verification failures.
  • Ensure local git tags exist in CI before creating Tauri releases to avoid tag-related build issues.
  • Disable Husky git hooks in CI to prevent install-time failures during automated builds.

Enhancements:

  • Pin pnpm to version 9 and configure onlyBuiltDependencies to ensure required native build dependencies are installed under newer pnpm behavior.
  • Upgrade Node.js version to 22 in dev and release workflows for a more up-to-date runtime environment.
  • Fetch full git history (depth 0) in CI workflows to support tagging and release tasks that depend on repository history.

CI:

  • Extend release and WebView2 workflows to run on both tag pushes and manual dispatch events with appropriate job conditions.

veyvin and others added 12 commits July 26, 2026 13:36
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
feat: 增强 release 工作流以确保 git 标签可用
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
chore: upgrade Node.js to v22 in CI workflows
pnpm latest (11) ignores dependency build scripts by default, which fails husky prepare during install. Also disable husky in CI and whitelist native build deps for future pnpm 10+.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
ci: add TAURI_UPDATER_* secrets to tauri-action workflow
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
ci: fix tauri updater signing by removing invalid TAURI_UPDATER_* env
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
@sourcery-ai

sourcery-ai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Reviewer's Guide

更新 Tauri 更新器签名配置和发布工作流,以对齐 Tauri v2 的单行 base64 签名密钥,同时让发布流程可通过 workflow_dispatch 触发,并兼容 pnpm 9 和 Node 22。

File-Level Changes

Change Details Files
允许 Release 工作流被手动触发,并在没有现有 tag 的情况下,通过在 CI 中推导/确保版本 tag,使其依然可以运行。
  • 添加 workflow_dispatch 输入 version,并在非 tag 触发时,将其用于 run-name
  • 放宽作业的 if 条件,使发布作业既能在版本 tag 上运行,也能在 workflow_dispatch 事件上运行。
  • 在 macOS 和 Windows runner 上添加步骤,以获取 tags,并在解析得到的版本 tag 不存在时创建本地 tag。
.github/workflows/release.yml
通过固定 pnpm 9 和 Node 22,并让 pnpm 安装兼容被忽略的构建脚本和 Husky,从而稳定 CI 工具链。
  • 在开发和发布工作流中将 pnpm 固定为 9 版本,并添加注释解释 pnpm 10 对构建脚本行为的更改。
  • 在使用 actions/setup-node 的工作流中,将 Node.js 升级到 22 版本。
  • 在执行 pnpm install 时设置 HUSKY=0,防止 Husky git hooks 在 CI 中运行。
  • 在 package.json 中配置 pnpm.onlyBuiltDependencies,以便在 pnpm 忽略构建脚本的行为下,仍然构建所需的原生/二进制依赖。
.github/workflows/release.yml
.github/workflows/dev.yml
package.json
在 CI 中保留 git 历史和 tags,以支持与发布相关的操作。
  • 配置 checkout 步骤使用 fetch-depth: 0,以便在后续步骤中可以使用完整历史(包括 tags)。
.github/workflows/release.yml
将 Tauri 更新器的公钥与新的 v2 签名密钥对对齐,并将密钥配置外部化到 GitHub Actions secrets。
  • 更新 tauri.conf.json 中的 updater.pubkey,使其匹配新生成的 Tauri v2 签名密钥对(单行 base64)。
  • 记录签名所需的 GitHub Actions secrets(TAURI_SIGNING_PRIVATE_KEY、TAURI_SIGNING_PRIVATE_KEY_PASSWORD、TAURI_UPDATER_PUBKEY),并明确说明它们必须是单行 base64 字符串。
src-tauri/tauri.conf.json

Tips and commands

Interacting with Sourcery

  • 触发新审查: 在 Pull Request 上评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 从审查评论生成 GitHub issue: 通过回复某条审查评论,要求 Sourcery 从该评论创建一个 issue。你也可以回复该审查评论 @sourcery-ai issue 来从中创建 issue。
  • 生成 Pull Request 标题: 在 Pull Request 标题中任意位置写上 @sourcery-ai 以随时生成标题。你也可以在 Pull Request 中评论 @sourcery-ai title 来(重新)生成标题。
  • 生成 Pull Request 概要: 在 Pull Request 正文中任意位置写上 @sourcery-ai summary,以在你需要的位置生成 PR 概要。你也可以在 Pull Request 中评论 @sourcery-ai summary 来(重新)生成概要。
  • 生成审查者指南: 在 Pull Request 中评论 @sourcery-ai guide,以随时(重新)生成审查者指南。
  • 一次性解决所有 Sourcery 评论: 在 Pull Request 中评论 @sourcery-ai resolve,以标记所有 Sourcery 评论为已解决。如果你已经处理完所有评论且不想再看到它们,这会非常有用。
  • 驳回所有 Sourcery 审查: 在 Pull Request 中评论 @sourcery-ai dismiss,以驳回所有现有的 Sourcery 审查。特别适用于你想从一次全新的审查开始——别忘了再评论 @sourcery-ai review 来触发新的审查!

Customizing Your Experience

访问你的 dashboard 以:

  • 启用或禁用审查特性,例如 Sourcery 生成的 Pull Request 概要、审查者指南等。
  • 更改审查语言。
  • 添加、移除或编辑自定义审查说明。
  • 调整其他审查设置。

Getting Help

Original review guide in English

Reviewer's Guide

Updates Tauri updater signing configuration and release workflows to align with Tauri v2’s single-line base64 signing keys, while making releases runnable via workflow_dispatch and compatible with pnpm 9 and Node 22.

File-Level Changes

Change Details Files
Allow Release workflow to be triggered manually and run even without an existing tag by deriving/ensuring the version tag in CI.
  • Add workflow_dispatch input version and use it in run-name when not running from a tag.
  • Relax job if conditions so publish jobs run on both version tags and workflow_dispatch events.
  • Add steps on macOS and Windows runners to fetch tags and create a local tag for the resolved version if it does not exist.
.github/workflows/release.yml
Stabilize CI tooling by pinning pnpm 9 and Node 22 and making pnpm installs compatible with ignored build scripts and Husky.
  • Pin pnpm to version 9 in dev and release workflows, with comments explaining pnpm 10 build-script behavior.
  • Bump Node.js to version 22 in workflows using actions/setup-node.
  • Set HUSKY=0 during pnpm install to prevent Husky git hooks from running in CI.
  • Configure pnpm.onlyBuiltDependencies in package.json so required native/binary dependencies still build under pnpm’s ignored-build behavior.
.github/workflows/release.yml
.github/workflows/dev.yml
package.json
Keep git history and tags available in CI for release-related operations.
  • Configure checkout steps to use fetch-depth: 0 so full history (including tags) is available for subsequent steps.
.github/workflows/release.yml
Align Tauri updater public key with new v2 signing keypair and externalize secrets setup to GitHub Actions secrets.
  • Update tauri.conf.json updater.pubkey to match a newly generated Tauri v2 signing keypair (single-line base64).
  • Document required GitHub Actions secrets for signing (TAURI_SIGNING_PRIVATE_KEY, TAURI_SIGNING_PRIVATE_KEY_PASSWORD, TAURI_UPDATER_PUBKEY) and clarify that they must be single-line base64 strings.
src-tauri/tauri.conf.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我发现了 1 个问题,并留下了一些整体性反馈:

  • workflow_dispatch 的输入 version 目前只在 run-name 中使用,而没有参与标签/版本解析逻辑,这可能会让期望用它来控制发布版本的调用方感到困惑;建议要么将它接入版本/标签选择逻辑,要么直接移除以避免歧义。
  • publish-tauripublish-webview2-fixed 这两个 job 现在有相当多重复的初始化逻辑(checkout、pnpm/node 设置、tag-sync 步骤、Husky 环境);建议把这些抽取到一个可复用的 workflow 或 composite action 中,这样未来的更改可以集中在一个地方。
给 AI Agent 的提示
Please address the comments from this code review:

## Overall Comments
- The `workflow_dispatch` input `version` is only used in `run-name` and not in the tag/version resolution logic, which may confuse callers expecting it to control the release version; consider either wiring it into the version/tag selection or removing it to avoid ambiguity.
- The `publish-tauri` and `publish-webview2-fixed` jobs now share quite a bit of duplicated setup logic (checkout, pnpm/node setup, tag-sync step, Husky env); consider extracting these into a reusable workflow or composite action to keep future changes in one place.

## Individual Comments

### Comment 1
<location path=".github/workflows/release.yml" line_range="7-9" />
<code_context>
 on:
   workflow_dispatch:
+    inputs:
+      version:
+        description: 'Release version (e.g., v1.0.0). If empty, uses package.json version'
+        required: false
   push:
</code_context>
<issue_to_address>
**suggestion (bug_risk):** The `version` workflow input is only used for the run-name and not for determining the actual release/tag version.

This behavior doesn’t match the input description and may suggest to users that `version` controls the release/tag version when it doesn’t. Please either route `inputs.version` into the `Get Version` logic (preferring it when set) or update the description so it accurately reflects that the version always comes from `package.json`.

```suggestion
      version:
        description: 'Optional label for this manual release run (used in run name only). Release/tag version always comes from package.json.'
        required: false
```
</issue_to_address>

Sourcery 对开源项目免费——如果你觉得我们的评审有帮助,欢迎分享 ✨
帮我变得更有用!请对每条评论点 👍 或 👎,我会根据你的反馈改进之后的评审。
Original comment in English

Hey - I've found 1 issue, and left some high level feedback:

  • The workflow_dispatch input version is only used in run-name and not in the tag/version resolution logic, which may confuse callers expecting it to control the release version; consider either wiring it into the version/tag selection or removing it to avoid ambiguity.
  • The publish-tauri and publish-webview2-fixed jobs now share quite a bit of duplicated setup logic (checkout, pnpm/node setup, tag-sync step, Husky env); consider extracting these into a reusable workflow or composite action to keep future changes in one place.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `workflow_dispatch` input `version` is only used in `run-name` and not in the tag/version resolution logic, which may confuse callers expecting it to control the release version; consider either wiring it into the version/tag selection or removing it to avoid ambiguity.
- The `publish-tauri` and `publish-webview2-fixed` jobs now share quite a bit of duplicated setup logic (checkout, pnpm/node setup, tag-sync step, Husky env); consider extracting these into a reusable workflow or composite action to keep future changes in one place.

## Individual Comments

### Comment 1
<location path=".github/workflows/release.yml" line_range="7-9" />
<code_context>
 on:
   workflow_dispatch:
+    inputs:
+      version:
+        description: 'Release version (e.g., v1.0.0). If empty, uses package.json version'
+        required: false
   push:
</code_context>
<issue_to_address>
**suggestion (bug_risk):** The `version` workflow input is only used for the run-name and not for determining the actual release/tag version.

This behavior doesn’t match the input description and may suggest to users that `version` controls the release/tag version when it doesn’t. Please either route `inputs.version` into the `Get Version` logic (preferring it when set) or update the description so it accurately reflects that the version always comes from `package.json`.

```suggestion
      version:
        description: 'Optional label for this manual release run (used in run name only). Release/tag version always comes from package.json.'
        required: false
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +7 to +9
version:
description: 'Release version (e.g., v1.0.0). If empty, uses package.json version'
required: false

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (bug_risk): version 这个 workflow 输入目前只用于 run-name,而不会用来决定实际的发布/标签版本。

这种行为与输入描述不符,也可能会让用户误以为 version 会控制发布/标签版本,而事实并非如此。请考虑要么将 inputs.version 接入 Get Version 逻辑(在其被设置时优先使用),要么更新描述,使其准确表达版本始终来自 package.json

Suggested change
version:
description: 'Release version (e.g., v1.0.0). If empty, uses package.json version'
required: false
version:
description: 'Optional label for this manual release run (used in run name only). Release/tag version always comes from package.json.'
required: false
Original comment in English

suggestion (bug_risk): The version workflow input is only used for the run-name and not for determining the actual release/tag version.

This behavior doesn’t match the input description and may suggest to users that version controls the release/tag version when it doesn’t. Please either route inputs.version into the Get Version logic (preferring it when set) or update the description so it accurately reflects that the version always comes from package.json.

Suggested change
version:
description: 'Release version (e.g., v1.0.0). If empty, uses package.json version'
required: false
version:
description: 'Optional label for this manual release run (used in run name only). Release/tag version always comes from package.json.'
required: false

Co-authored-by: traeagent <traeagent@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant