From a4a9fc8983270f779c9485e2589018effcb5ae5e Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 24 Sep 2026 10:54:28 +0000 Subject: [PATCH 1/4] =?UTF-8?q?ci:=20=E6=96=B0=E5=A2=9E=20macOS=20DMG=20?= =?UTF-8?q?=E5=8F=91=E7=89=88=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 打包 - macos-14(Apple Silicon)+ Python 3.13 调 scripts/build_macos.sh --dmg,依赖走 PyPI - offscreen 冒烟启动 20 s,进程提前退出即失败 2. 发布 - 版本号取 src/version.py,只往已存在的 comm-v<版本> Release 追加 CommTool_v<版本>.dmg - Release 已有同名 DMG 时整段跳过,不 clobber,保护已写入的 sha256_mac / size_mac - 上传后跑 check_mac_asset.py 门禁,并保留 14 天 workflow artifact Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01TSZhopixE2DC3VJmxrGUCz --- .github/workflows/release-macos.yml | 99 +++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 .github/workflows/release-macos.yml diff --git a/.github/workflows/release-macos.yml b/.github/workflows/release-macos.yml new file mode 100644 index 0000000..d5c98a8 --- /dev/null +++ b/.github/workflows/release-macos.yml @@ -0,0 +1,99 @@ +name: Release macOS DMG + +# 在 GitHub 的 Apple Silicon runner 上打 CommTool_v<版本>.dmg,并挂到已有的 +# comm-v<版本> Release(Release 由 Windows 发版脚本先建好)。 +# 幂等:Release 上已有同名 DMG 时直接跳过,不会 clobber,避免已写入 +# latest.json 的 sha256_mac / size_mac 失效。latest.json 回写仍走人工提交。 +on: + workflow_dispatch: + push: + paths: + - .github/workflows/release-macos.yml + +permissions: + contents: write + +concurrency: + group: release-macos + cancel-in-progress: false + +jobs: + build-dmg: + name: Build + upload macOS DMG + runs-on: macos-14 + timeout-minutes: 45 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + + - name: Resolve version / release state + id: meta + run: | + VER=$(python3 -c "import re;print(re.search(r'__version__\s*=\s*\"([^\"]+)\"', open('src/version.py',encoding='utf-8').read()).group(1))") + TAG="comm-v$VER" + DMG="CommTool_v$VER.dmg" + echo "version=$VER" >> "$GITHUB_OUTPUT" + echo "tag=$TAG" >> "$GITHUB_OUTPUT" + echo "dmg=$DMG" >> "$GITHUB_OUTPUT" + if ! gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json tagName >/dev/null; then + echo "::error::Release $TAG 不存在;先跑 Windows 发版建 Release" + exit 1 + fi + if gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json assets \ + --jq '.assets[].name' | grep -Fxq "$DMG"; then + echo "::notice::$TAG 已有 $DMG,跳过打包与上传" + echo "skip=true" >> "$GITHUB_OUTPUT" + else + echo "skip=false" >> "$GITHUB_OUTPUT" + fi + + - uses: actions/setup-python@v5 + if: steps.meta.outputs.skip != 'true' + id: py + with: + python-version: "3.13" + + - name: Build .app + .dmg + if: steps.meta.outputs.skip != 'true' + env: + COMMTOOL_BUILD_PYTHON: ${{ steps.py.outputs.python-path }} + PIP_INDEX: https://pypi.org/simple + run: bash scripts/build_macos.sh --dmg + + - name: Smoke launch (offscreen) + if: steps.meta.outputs.skip != 'true' + env: + QT_QPA_PLATFORM: offscreen + run: | + file dist/CommTool.app/Contents/MacOS/CommTool + dist/CommTool.app/Contents/MacOS/CommTool > smoke.log 2>&1 & + PID=$! + sleep 20 + if ! kill -0 "$PID" 2>/dev/null; then + echo "::error::CommTool 启动 20 s 内退出" + cat smoke.log + exit 1 + fi + kill "$PID" || true + wait "$PID" 2>/dev/null || true + cat smoke.log + + - name: Upload DMG to release + if: steps.meta.outputs.skip != 'true' + run: | + cp dist/CommTool.dmg "dist/${{ steps.meta.outputs.dmg }}" + shasum -a 256 "dist/${{ steps.meta.outputs.dmg }}" + stat -f '%z bytes' "dist/${{ steps.meta.outputs.dmg }}" + gh release upload "${{ steps.meta.outputs.tag }}" \ + "dist/${{ steps.meta.outputs.dmg }}" --repo "$GITHUB_REPOSITORY" + python3 scripts/check_mac_asset.py "${{ steps.meta.outputs.version }}" \ + --repo "$GITHUB_REPOSITORY" + + - name: Keep DMG as workflow artifact + if: steps.meta.outputs.skip != 'true' + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.meta.outputs.dmg }} + path: dist/${{ steps.meta.outputs.dmg }} + retention-days: 14 From cb4bb6e988ceeecb9ca4a512580ba75a51110126 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 24 Sep 2026 10:57:18 +0000 Subject: [PATCH 2/4] release: enable macOS v1.8.3 download MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. macOS 安装包 - GitHub Actions macos-14(Apple Silicon)+ Python 3.13 用 build_macos.sh --dmg 打包 CommTool_v1.8.3.dmg - offscreen 冒烟启动通过,已挂到 GitHub Release comm-v1.8.3(Gitee 标准流程不放 dmg) - 发布门禁 check_mac_asset.py 通过 2. 在线更新 - latest.json 写入 url_mac 指向该 GitHub 直链 - sha256_mac / size_mac 按下载回来的 DMG 计算,与 GitHub 资产 digest 一致 - Windows / Linux 摘要与下载地址未改 3. 验证 - test_update_manifest_integrity / test_updater_mac 12 个通过 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01TSZhopixE2DC3VJmxrGUCz --- latest.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/latest.json b/latest.json index 83edf79..e0f7caf 100644 --- a/latest.json +++ b/latest.json @@ -1,14 +1,16 @@ { "version": "1.8.3", "url": "https://gitee.com/heropml/SerialTool/releases/download/comm-v1.8.3/CommTool_Setup_v1.8.3.exe", - "url_mac": [], + "url_mac": [ + "https://github.com/heropml/SerialTool/releases/download/comm-v1.8.3/CommTool_v1.8.3.dmg" + ], "url_linux": [ "https://github.com/heropml/SerialTool/releases/download/comm-v1.8.3/CommTool_Setup_v1.8.3_linux_x86_64.run" ], "sha256": "8e0a5957ed2a4b584788b2e2a648d9482ac77632bdac3c0471439f080954d717", "size": 48744602, - "sha256_mac": "", - "size_mac": 0, + "sha256_mac": "6b46baa6ab9ca8d7b5cf351234a4b4cc34468f06c97396264e7f74166a2cb49d", + "size_mac": 50024267, "sha256_linux": "2a0c87ec5f7e6cfbb263965b7fb4afa748774400c160ff83ac7e08ed886d0c39", "size_linux": 130058405, "notes": "串口调试助手 / 网络调试工具:启动提速,窗口首帧更快画出" From fbcb950565fcdcc807e87a6d0f4edc43cc992d53 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 24 Sep 2026 10:57:18 +0000 Subject: [PATCH 3/4] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=20macOS=20v1.8.3?= =?UTF-8?q?=20=E5=8F=91=E5=B8=83=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 发布状态 - README v71、发行说明与排期标记 Windows / macOS / Linux x86_64 均已发 - 发行说明下载表填入 CommTool_v1.8.3.dmg,删除 macOS 待补包说明 2. 三语用户文档 - USAGE / 使用说明 / 使用說明 的 v1.8.3 发布范围改为三平台已发 - 安装章节当前版本改为三平台 v1.8.3,macOS 资产文件名改为 v1.8.3 3. 验证 - git diff --cached --check 通过 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01TSZhopixE2DC3VJmxrGUCz --- README.md | 2 +- docs/RELEASE_NOTES.md | 5 ++--- docs/SCHEDULE.md | 2 +- docs/USAGE.md | 6 +++--- "docs/\344\275\277\347\224\250\350\252\252\346\230\216.md" | 6 +++--- "docs/\344\275\277\347\224\250\350\257\264\346\230\216.md" | 6 +++--- 6 files changed, 13 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 1ee3f1e..ec10160 100644 --- a/README.md +++ b/README.md @@ -670,7 +670,7 @@ python -c "import base64, textwrap; b64 = '\n'.join(textwrap.wrap(base64.b64enco - **v68 (v1.8.0)**: **正式版** — **SEGGER J-Link RTT**(器件目录选择窗、SWD/JTAG、速度/通道/控制块搜索、可选复位、探针 SN 选择与安全自动回退);DLL 访问串行化、控制块等待提示、RTT 运行期错误反馈;三语文档与示例工程同步。Windows / macOS / Linux x86_64 已发。 - **v69 (v1.8.1)**: 侧栏图钉自动隐藏、悬停浮层与布局记忆;修复快速扫过误展开和切换工作台后浮层回弹。Windows Setup / onefile 发布,macOS / Linux 新版待补包。 - **v70 (v1.8.2)**: **正式版** — **弹窗全面主题化**(删除预设确认、帧构造器/Modbus 主机/脚本控制台命名输入、8 窗口上限提示全部换主题化对话框,跟随语言与主题);**发送框粘贴只取纯文本**(不再带入网页/Word 的富文本格式)。Windows Setup / onefile 发布,macOS / Linux 新版待补包。1807 collected 全量通过。 -- **v71 (v1.8.3)**: **正式版** — **启动提速**(启动按已存主题只应用一次样式、全局事件过滤器对无关事件直接放行、RTT 器件表枚举推迟到主窗口首帧之后);安装版启动到首帧约 1.35 s → 1.03 s(上次停在 RTT 约 1.69 s → 1.03 s),界面外观不变。Windows Setup / onefile 与 Linux x86_64 已发,macOS 新版待补包。1815 collected 全量通过。 +- **v71 (v1.8.3)**: **正式版** — **启动提速**(启动按已存主题只应用一次样式、全局事件过滤器对无关事件直接放行、RTT 器件表枚举推迟到主窗口首帧之后);安装版启动到首帧约 1.35 s → 1.03 s(上次停在 RTT 约 1.69 s → 1.03 s),界面外观不变。Windows / macOS / Linux x86_64 已发。1815 collected 全量通过。 --- diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index 3271a79..7c82172 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -16,8 +16,7 @@ ### 发布范围 -- **Windows** 安装版、单文件版与 **Linux x86_64** 安装包已发布,tag 为 `comm-v1.8.3`。 -- macOS(Apple Silicon)本版本待补包,更新清单暂不提供该平台的新版本自动下载地址。 +- **Windows** 安装版、单文件版、**macOS(Apple Silicon)** DMG 与 **Linux x86_64** 安装包均已发布,tag 为 `comm-v1.8.3`。 ## 下载 @@ -25,7 +24,7 @@ |------|------|------| | Windows 安装版 | `CommTool_Setup_v1.8.3.exe` | 推荐,向导安装 + 桌面快捷方式 | | Windows 单文件版 | `CommTool_v1.8.3.exe` | 免安装,首次启动需要自解压 | -| macOS(Apple Silicon) | 待补包 | 本版本尚未提供 | +| macOS(Apple Silicon) | `CommTool_v1.8.3.dmg` | arm64 `.dmg`,拖入“应用程序”安装 | | Linux(x86_64) | `CommTool_Setup_v1.8.3_linux_x86_64.run` | 免 sudo,默认 `~/.local/opt/CommTool`;glibc ≥ 2.27(Ubuntu 18.04+ / 多数麒麟) | > Windows 10/11(64 位)无需安装 Python。旧版用户可通过「帮助 → 关于 → 检查更新」升级(国内优先走 Gitee,海外回退 GitHub)。RTT 功能仍需额外安装 SEGGER J-Link 驱动。 diff --git a/docs/SCHEDULE.md b/docs/SCHEDULE.md index 59cde42..f03f688 100644 --- a/docs/SCHEDULE.md +++ b/docs/SCHEDULE.md @@ -21,7 +21,7 @@ | 指标 | 数值 | 备注 | |---|---|---| -| 发布版 | `comm-v1.8.3` | Windows Setup/onefile 与 Linux x86_64 `.run` 已发布;macOS 新版待补包;清单带 Windows / Linux `sha256` / `size` | +| 发布版 | `comm-v1.8.3` | Windows Setup/onefile、macOS DMG 与 Linux x86_64 `.run` 均已发布;清单带各平台 `sha256` / `size` | | 测试 | **1815 collected** | 全量执行通过;Ruff 与编译检查通过 | | `main_window.py` | ~13600 行 | S-2 55 knives **已收口**;壳层有意保留 | | 最长函数 | `__init__` / 连接侧 | `apply_style` / `_apply_language` 已薄拆到 `app_style` / `i18n_ui` | diff --git a/docs/USAGE.md b/docs/USAGE.md index 6d9755b..0ab2431 100644 --- a/docs/USAGE.md +++ b/docs/USAGE.md @@ -66,7 +66,7 @@ On an empty terminal, use the **Quick start** bar for a Virtual loopback, a bund - **RTT catalog after first paint** — when the last session was on RTT, the J-Link device catalog is enumerated only after the main window's first frame is drawn. If startup does not end on RTT, it is not enumerated; clicking **…** or changing the driver folder still enumerates immediately. - **Measured** — installed build, launch to first frame drawn: about 1.35 s → 1.03 s typically, 1.69 s → 1.03 s when the last session was on RTT. - **Compatibility** — the UI looks the same; no changes to connection protocols, RX/TX behavior, or the configuration format; no new dependencies. -- Windows Setup, onefile, and the Linux x86_64 `.run` are published; the macOS package for this version is pending. +- Windows Setup, onefile, the macOS Apple Silicon DMG, and the Linux x86_64 `.run` are all published. ## What's New in v1.8.2 @@ -1078,7 +1078,7 @@ A: Writes are append-only — even hundreds of MB stay smooth. **Max Lines** onl ## Install (Windows / macOS / Linux) -Download from [GitHub Releases](https://github.com/heropml/SerialTool/releases). Current Windows and Linux release is **v1.8.3**. Windows Setup is also on [Gitee](https://gitee.com/heropml/SerialTool/releases/tag/comm-v1.8.3); Gitee does not host the Mac or Linux packages. macOS remains on v1.8.0 until a new package is published. +Download from [GitHub Releases](https://github.com/heropml/SerialTool/releases). Current Windows, macOS, and Linux release is **v1.8.3**. Windows Setup is also on [Gitee](https://gitee.com/heropml/SerialTool/releases/tag/comm-v1.8.3); Gitee does not host the Mac or Linux packages. ### Windows @@ -1088,7 +1088,7 @@ Download from [GitHub Releases](https://github.com/heropml/SerialTool/releases). ### macOS -- **Apple Silicon** (arm64) only: download `CommTool_v1.8.0.dmg` from `comm-v1.8.0` +- **Apple Silicon** (arm64) only: download `CommTool_v1.8.3.dmg` from `comm-v1.8.3` - Open the DMG and drag CommTool into **Applications** - If macOS says the app is damaged (not notarized), run once: diff --git "a/docs/\344\275\277\347\224\250\350\252\252\346\230\216.md" "b/docs/\344\275\277\347\224\250\350\252\252\346\230\216.md" index bd9e150..1bfdcf8 100644 --- "a/docs/\344\275\277\347\224\250\350\252\252\346\230\216.md" +++ "b/docs/\344\275\277\347\224\250\350\252\252\346\230\216.md" @@ -105,7 +105,7 @@ - **RTT 器件表延後** — 上次停在 RTT 時,J-Link 器件表等主視窗首幀畫完再列舉;啟動結束時沒停在 RTT 則不列舉,點「…」或更換驅動目錄仍立即列舉。 - **實測效果** — 安裝版啟動到首幀畫完:一般約 1.35 s → 1.03 s,上次停在 RTT 約 1.69 s → 1.03 s。 - **相容性** — 介面外觀不變;不涉及連線協定、收發行為與設定格式;無新相依。 -- **發布範圍** — Windows 安裝版、單檔版與 Linux x86_64 `.run` 已發布;macOS 新版待補包。 +- **發布範圍** — Windows 安裝版、單檔版、macOS Apple Silicon DMG 與 Linux x86_64 `.run` 均已發布。 ## ⭐ CommTool v1.8.2 彈窗主題化與貼上修復 @@ -1106,7 +1106,7 @@ A:寫入是追加模式,幾十 MB / 幾百 MB 都不會卡。「最大行數 ## 6. 安裝與系統需求 -安裝包從 [GitHub Releases](https://github.com/heropml/SerialTool/releases) 下載。目前 Windows 與 Linux 正式版 **v1.8.3**。國內也可從 [Gitee Release](https://gitee.com/heropml/SerialTool/releases/tag/comm-v1.8.3) 取 **Windows Setup**(Gitee 不放 Mac / Linux 包)。macOS 暫沿用 v1.8.0,新版待補包。 +安裝包從 [GitHub Releases](https://github.com/heropml/SerialTool/releases) 下載。目前 Windows / macOS / Linux 正式版 **v1.8.3**。國內也可從 [Gitee Release](https://gitee.com/heropml/SerialTool/releases/tag/comm-v1.8.3) 取 **Windows Setup**(Gitee 不放 Mac / Linux 包)。 ### Windows @@ -1116,7 +1116,7 @@ A:寫入是追加模式,幾十 MB / 幾百 MB 都不會卡。「最大行數 ### macOS -- 僅 **Apple Silicon**(arm64):從 `comm-v1.8.0` 下載 `CommTool_v1.8.0.dmg` +- 僅 **Apple Silicon**(arm64):從 `comm-v1.8.3` 下載 `CommTool_v1.8.3.dmg` - 開啟 DMG,把 CommTool 拖進「應用程式」 - 若提示「已損壞,無法打開」(未公證),在終端執行一次: diff --git "a/docs/\344\275\277\347\224\250\350\257\264\346\230\216.md" "b/docs/\344\275\277\347\224\250\350\257\264\346\230\216.md" index d549e94..449aaa3 100644 --- "a/docs/\344\275\277\347\224\250\350\257\264\346\230\216.md" +++ "b/docs/\344\275\277\347\224\250\350\257\264\346\230\216.md" @@ -105,7 +105,7 @@ - **RTT 器件表延后** — 上次停在 RTT 时,J-Link 器件表等主窗口首帧画完再枚举;启动结束时没停在 RTT 则不枚举,点「…」或更换驱动目录仍立即枚举。 - **实测效果** — 安装版启动到首帧画完:常规约 1.35 s → 1.03 s,上次停在 RTT 约 1.69 s → 1.03 s。 - **兼容性** — 界面外观不变;不涉及连接协议、收发行为与配置格式;无新依赖。 -- **发布范围** — Windows 安装版、单文件版与 Linux x86_64 `.run` 已发布;macOS 新版待补包。 +- **发布范围** — Windows 安装版、单文件版、macOS Apple Silicon DMG 与 Linux x86_64 `.run` 均已发布。 ## ⭐ CommTool v1.8.2 弹窗主题化与粘贴修复 @@ -1138,7 +1138,7 @@ A:说明当前没有命中的行。先在「关键字高亮」里配好关键 ## 9. 安装与系统要求 -安装包从 [GitHub Releases](https://github.com/heropml/SerialTool/releases) 下载。当前 Windows 与 Linux 正式版 **v1.8.3**。国内也可从 [Gitee Release](https://gitee.com/heropml/SerialTool/releases/tag/comm-v1.8.3) 取 **Windows Setup**(Gitee 不放 Mac / Linux 包)。macOS 暂沿用 v1.8.0,新版待补包。 +安装包从 [GitHub Releases](https://github.com/heropml/SerialTool/releases) 下载。当前 Windows / macOS / Linux 正式版 **v1.8.3**。国内也可从 [Gitee Release](https://gitee.com/heropml/SerialTool/releases/tag/comm-v1.8.3) 取 **Windows Setup**(Gitee 不放 Mac / Linux 包)。 ### Windows @@ -1148,7 +1148,7 @@ A:说明当前没有命中的行。先在「关键字高亮」里配好关键 ### macOS -- 仅 **Apple Silicon**(arm64):从 `comm-v1.8.0` 下载 `CommTool_v1.8.0.dmg` +- 仅 **Apple Silicon**(arm64):从 `comm-v1.8.3` 下载 `CommTool_v1.8.3.dmg` - 打开 DMG,把 CommTool 拖进「应用程序」 - 若提示「已损坏,无法打开」(未公证),在终端执行一次: From b96e9a7f2245f2ed865af70789967073a36bb562 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 24 Sep 2026 11:02:25 +0000 Subject: [PATCH 4/4] =?UTF-8?q?ci:=20macOS=20=E5=8F=91=E7=89=88=20workflow?= =?UTF-8?q?=20=E5=90=8C=E6=AD=A5=20Release=20=E6=AD=A3=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - DMG 上传(或已存在)后,用 docs/RELEASE_NOTES.md 全文更新 GitHub Release 正文,与 release.ps1 同源 - 仅当发行说明已列出当前版本的 DMG 文件名时才同步,避免用旧文案覆盖 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01TSZhopixE2DC3VJmxrGUCz --- .github/workflows/release-macos.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/release-macos.yml b/.github/workflows/release-macos.yml index d5c98a8..ffb00a2 100644 --- a/.github/workflows/release-macos.yml +++ b/.github/workflows/release-macos.yml @@ -90,6 +90,17 @@ jobs: python3 scripts/check_mac_asset.py "${{ steps.meta.outputs.version }}" \ --repo "$GITHUB_REPOSITORY" + # Release 正文与 release.ps1 同源:docs/RELEASE_NOTES.md 全文。DMG 挂上后正文里的 + # macOS 行随之变成下载文件名;只在发行说明确属当前版本时才同步。 + - name: Sync release notes + run: | + if ! grep -Fq "${{ steps.meta.outputs.dmg }}" docs/RELEASE_NOTES.md; then + echo "::notice::docs/RELEASE_NOTES.md 未列出 ${{ steps.meta.outputs.dmg }},不改 Release 正文" + exit 0 + fi + gh release edit "${{ steps.meta.outputs.tag }}" --repo "$GITHUB_REPOSITORY" \ + --notes-file docs/RELEASE_NOTES.md + - name: Keep DMG as workflow artifact if: steps.meta.outputs.skip != 'true' uses: actions/upload-artifact@v4