From 2bd2b6d1af2d114e4b14b537ba9401b879483eef Mon Sep 17 00:00:00 2001 From: zerorigin2019 Date: Mon, 16 Nov 2026 11:14:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=B8=83=200.2.2=EF=BC=9A=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E5=88=86=E5=8F=91=E4=BA=A7=E7=89=A9=E5=B8=A6=E7=AD=BE?= =?UTF-8?q?=E5=90=8D=EF=BC=8C=E4=BF=AE=E5=8F=91=E5=B8=83=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E8=AF=BB=20manifest=20=E7=9A=84=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mygo.json version -> 0.2.2;CHANGELOG 加 0.2.2 小节。publish-gitea.ps1 读 update-windows-amd64.json 时补 -Encoding UTF8(PS 5.1 默认 ANSI 解码,中文 notes 乱码导致 ConvertFrom-Json 直接失败)。AGENTS.md 补该坑。产物:setup/tar.gz/portable.zip 全部签名 Valid;端到端 0.2.1->0.2.2 走 24KB delta。 --- AGENTS.md | 4 +++- CHANGELOG.md | 9 +++++++++ mygo.json | 2 +- scripts/publish-gitea.ps1 | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 5bab1a2..9dd0f52 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -233,7 +233,9 @@ Windows 轻量自动化工具箱:**单个 mygo 进程**(托盘常驻 + 原 + `-f`(双引号里 ```$` 会把 `$` 转义,正文会留下字面 `$(...)`); - `build.bat` 读 `mygo.json` 的版本号必须 `Get-Content -Raw -Encoding UTF8`:不加会按 GBK 读中文, `ConvertFrom-Json` 报 `Invalid object passed in, ':' or '}' expected`,版本号取空 → 便携版 zip - 被命名成 `0.0.0`。zip 名对不上发布脚本的过滤器就传不上去; + 被命名成 `0.0.0`。zip 名对不上发布脚本的过滤器就传不上去;同理 `publish-gitea.ps1` 读 + `update-.json` 必须 `Get-Content -Raw -Encoding UTF8`:不加时 manifest 里的中文 notes + 被按 GBK 解码,`ConvertFrom-Json` 报「传入的对象无效,应为“:”或“}”」,发布第一步就中断(0.2.2 踩到); - Gitea 的 `allowed_types` 白名单只影响 issue 之类附件,**Release 附件实测接受 `.exe` 与 `.delta`** (setup 安装包、增量包都直接上传成功),不需要再套一层 zip;脚本里保留「delta 失败只警告」的容错; - 自签名证书**不能用 mygo 的 `windows.certificate` 路径**:它固定给 signtool 传 diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f9faef..1ad500f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ mygo 构建会用 `## ` 段落作为更新窗口里的发布说明: `mygo.json` 的 `version` 改掉,再在下面加一段同名小节,否则 `mygo build` 会报 “CHANGELOG.md has no notes for ”。 +## 0.2.2 - 2026-11-16 + +代码签名版本:所有分发产物都带 Authenticode 签名,导入过根证书的机器不再提示「无法验证发布者」。 + +- 主程序、watchdog、安装包与卸载器统一签名(`mygo.json` 的 `windows.signCommand`) +- 新增 `scripts/codesign/`:生成自签名证书、签名单个文件、导入信任三个脚本 +- 公钥证书 `certs/ZeroOrigin-CodeSign.cer`,新机器跑 `trust.ps1` 后生效 +- 程序行为与 0.2.1 一致 + ## 0.2.1 - 2026-11-16 更新链路验证版本:程序行为与 0.2.0 一致,主要用来验证「检查更新 → 下载 → 就地替换 → 重启」。 diff --git a/mygo.json b/mygo.json index ad4c9bb..b2607f4 100644 --- a/mygo.json +++ b/mygo.json @@ -2,7 +2,7 @@ "name": "ZerOriginTool", "slug": "zerorigin-toolbox", "identifier": "cn.zerorigin.toolbox", - "version": "0.2.1", + "version": "0.2.2", "copyright": "© 2026 零源", "publisher": "零源", "main": "./cmd/zerorigin", diff --git a/scripts/publish-gitea.ps1 b/scripts/publish-gitea.ps1 index c9f9d4a..ef50a9c 100644 --- a/scripts/publish-gitea.ps1 +++ b/scripts/publish-gitea.ps1 @@ -59,7 +59,7 @@ if (-not (Test-Path -LiteralPath $Dir)) { throw "找不到构建输出目录:$ # manifest 是唯一必须存在的产物:没有它就没有更新可发。 $manifest = Get-ChildItem -LiteralPath $Dir -Filter "update-*-*.json" | Select-Object -First 1 if (-not $manifest) { throw "$Dir 里没有 update-.json:构建时没带签名私钥?" } -$m = Get-Content -LiteralPath $manifest.FullName -Raw | ConvertFrom-Json +$m = Get-Content -LiteralPath $manifest.FullName -Raw -Encoding UTF8 | ConvertFrom-Json $version = $m.version if (-not $version) { throw "$($manifest.Name) 里没有 version 字段" } $archiveName = Split-Path -Leaf ([uri]$m.url).AbsolutePath