Skip to content

Commit 5777c70

Browse files
committed
fix(release): publish unsigned macOS DMG fallback
Root cause: the macOS Tauri build already generated bundle/dmg/CCSwitchMulti_*_universal.dmg without Apple signing secrets, but Prepare macOS Assets exited as soon as APPLE_SIGNING_IDENTITY was empty. That made the release succeed while omitting the macOS DMG asset. Fix: when Apple signing is unavailable, locate the Tauri-generated DMG, copy it to release-assets with the standard macOS DMG release filename, and fail the macOS job if no unsigned DMG exists. Signed Apple releases still use the create-dmg plus notarization path. Release: bump CCSwitchMulti to v3.16.4-10, add Chinese release notes, update the GitHub release body to disclose unsigned DMG behavior, and record the invariant in project memory. Validation: pnpm exec prettier --check release workflow/version docs/memory; pnpm typecheck; cargo metadata reports 3.16.4-10; pnpm dlx js-yaml parses release.yml; git diff --cached --check passed. actionlint is not installed on this host and Go is unavailable for go-run actionlint.
1 parent f67dc89 commit 5777c70

7 files changed

Lines changed: 48 additions & 11 deletions

File tree

.github/workflows/release.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -391,16 +391,32 @@ jobs:
391391
ditto -c -k --sequesterRsrc --keepParent "$APP_PATH" "release-assets/$NEW_ZIP"
392392
echo "macOS zip ready: $NEW_ZIP"
393393
394-
# 3) Create styled DMG only when signing identity is available.
395-
# Fork repos often lack Apple signing secrets; in that case still ship
396-
# the updater tarball and zip instead of failing the whole release.
394+
# 3) 收集 DMG。没有 Apple 签名时,发布 Tauri 已生成的未签名 DMG,
395+
# 避免工作流成功但 Release 静默缺少 macOS DMG。
396+
NEW_DMG="CC-Switch-${VERSION}-macOS.dmg"
397397
if [ -z "${APPLE_SIGNING_IDENTITY:-}" ]; then
398-
echo "⚠️ APPLE_SIGNING_IDENTITY is missing; skipping macOS DMG packaging and notarization"
398+
DMG_PATH=""
399+
for path in \
400+
"src-tauri/target/universal-apple-darwin/release/bundle/dmg" \
401+
"src-tauri/target/aarch64-apple-darwin/release/bundle/dmg" \
402+
"src-tauri/target/x86_64-apple-darwin/release/bundle/dmg" \
403+
"src-tauri/target/release/bundle/dmg"; do
404+
if [ -d "$path" ]; then
405+
[ -z "$DMG_PATH" ] && DMG_PATH=$(find "$path" -maxdepth 1 -name "*.dmg" -type f | head -1 || true)
406+
fi
407+
done
408+
409+
if [ -z "$DMG_PATH" ]; then
410+
echo "❌ APPLE_SIGNING_IDENTITY is missing and no unsigned macOS .dmg artifact was found" >&2
411+
exit 1
412+
fi
413+
414+
cp "$DMG_PATH" "release-assets/$NEW_DMG"
415+
echo "⚠️ APPLE_SIGNING_IDENTITY is missing; publishing unsigned macOS DMG: $NEW_DMG"
399416
exit 0
400417
fi
401418
402419
HOMEBREW_NO_AUTO_UPDATE=1 brew install create-dmg
403-
NEW_DMG="CC-Switch-${VERSION}-macOS.dmg"
404420
DMG_STAGE_DIR="$RUNNER_TEMP/dmg-stage"
405421
rm -rf "$DMG_STAGE_DIR"
406422
mkdir -p "$DMG_STAGE_DIR"
@@ -720,7 +736,7 @@ jobs:
720736
721737
### 下载
722738
723-
- **macOS**: `CC-Switch-${{ github.ref_name }}-macOS.dmg`(推荐)或 `CC-Switch-${{ github.ref_name }}-macOS.zip`(解压即用)
739+
- **macOS**: `CC-Switch-${{ github.ref_name }}-macOS.dmg`(未配置 Apple 签名时为未签名版)或 `CC-Switch-${{ github.ref_name }}-macOS.zip`(解压即用)
724740
- **Windows (x86_64)**: `CC-Switch-${{ github.ref_name }}-Windows-Setup.exe`(安装版)或 `CC-Switch-${{ github.ref_name }}-Windows-Portable.zip`(绿色版)
725741
- **Windows (ARM64)**: `CC-Switch-${{ github.ref_name }}-Windows-arm64-Setup.exe`(安装版)或 `CC-Switch-${{ github.ref_name }}-Windows-arm64-Portable.zip`(绿色版)
726742
- **Linux (x86_64)**: `CC-Switch-${{ github.ref_name }}-Linux-x86_64.AppImage` / `.deb` / `.rpm`
@@ -729,7 +745,7 @@ jobs:
729745
> `.tar.gz` 为 Tauri updater 自动更新专用,无需手动下载。
730746
731747
---
732-
macOS DMG 仅在仓库配置 Apple 签名和公证密钥时生成;未配置时发布 updater tarball 和 app zip。
748+
macOS DMG 在仓库配置 Apple 签名和公证密钥时会签名并公证;未配置时发布 Tauri 生成的未签名 DMG、updater tarball 和 app zip。
733749
files: release-assets/*
734750
env:
735751
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# CCSwitchMulti v3.16.4-10 发布说明
2+
3+
本版本继续补齐 GitHub Release 的 macOS 资产发布链路。
4+
5+
## 修复
6+
7+
- macOS Release 在没有 Apple Developer ID 签名和公证凭据时,也会上传 Tauri 已生成的未签名 DMG:`CC-Switch-v3.16.4-10-macOS.dmg`
8+
- 无签名路径不再静默跳过 DMG。如果 Tauri 没有生成 `.dmg`,macOS job 会直接失败,避免出现 GitHub Release 成功但缺少 macOS DMG 的状态。
9+
- GitHub Release 下载说明同步标注:macOS DMG 在缺少 Apple 签名配置时是未签名版本;后续补齐 Apple secrets 后会自动切换为签名和公证版本。
10+
11+
## 验证
12+
13+
- `v3.16.4-9` 已验证 Linux、Windows x64、Windows ARM64、macOS universal build、正式 Release 和 `latest.json` 全链路成功。
14+
- 本版本用于验证 macOS 未签名 DMG 也能进入 Release 资产列表,同时保留 updater 使用的 universal `macOS.tar.gz`

memory.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# CC Switch Repository Memory
22

3+
## 2026-07-03 macOS Unsigned DMG Release Fallback
4+
5+
- `v3.16.4-9` 的 GitHub macOS job 已证明 Tauri 会在 `pnpm tauri build --target universal-apple-darwin` 阶段生成 `src-tauri/target/universal-apple-darwin/release/bundle/dmg/CCSwitchMulti_*_universal.dmg`,即使仓库缺少 Apple 签名和公证 secrets。
6+
- 真实缺口在 `Prepare macOS Assets`:旧逻辑在 `APPLE_SIGNING_IDENTITY` 为空时只上传 updater tarball 和 app zip,然后 `exit 0`,导致 Release 成功但没有 macOS DMG。
7+
- 修复边界:无 Apple 签名时也必须把 Tauri 生成的 unsigned DMG 复制为 `CC-Switch-${tag}-macOS.dmg` 并上传;如果无签名且找不到 `.dmg`,macOS job 应失败而不是静默缺资产。Apple secrets 齐全时仍走 `create-dmg` 的签名/公证路径。
8+
- Release 文案必须明确:缺 Apple 签名配置时 macOS DMG 是未签名版本;补齐 Apple Developer ID 证书和 notarization secrets 后,同一 workflow 会自动发布签名并公证的 DMG。
9+
310
## 2026-07-03 CCSwitchMulti v3.16.4-9 GitHub Release Verification
411

512
- `v3.16.4-9` 已推到 `BigStrongSun/ccswitchmulti` 并通过 GitHub Actions release run `28610511658`,head sha 为 `0e8b25cdd0cbfe8e2bff054b46850ce1c5215c0e`。该 run 覆盖 Linux x64、Linux ARM64、Windows x64、Windows ARM64、macOS universal、Publish GitHub Release 和 Assemble `latest.json`,全部成功。

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cc-switch-multi",
3-
"version": "3.16.4-9",
3+
"version": "3.16.4-10",
44
"description": "All-in-One Assistant for Claude Code, Codex & Gemini CLI",
55
"type": "module",
66
"scripts": {

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cc-switch"
3-
version = "3.16.4-9"
3+
version = "3.16.4-10"
44
description = "All-in-One Assistant for Claude Code, Codex & Gemini CLI"
55
authors = ["Jason Young"]
66
license = "MIT"

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "CCSwitchMulti",
4-
"version": "3.16.4-9",
4+
"version": "3.16.4-10",
55
"identifier": "com.ccswitchmulti.desktop",
66
"build": {
77
"frontendDist": "../dist",

0 commit comments

Comments
 (0)