Skip to content

Commit 8e93cd6

Browse files
committed
fix(release): retry latest metadata assembly
Root cause: v3.16.4-10 successfully uploaded the unsigned macOS DMG fallback, but the release workflow failed later in Assemble latest.json because gh release download hit a transient GitHub asset API HTTP 503 after assets were already published. That left a downloadable release without updater metadata. Change: add bounded retries around gh release download and gh release upload latest.json in assemble-latest-json, bump version surfaces to 3.16.4-11, add release notes, and record the release failure boundary in memory.md. Validation: pnpm exec prettier --check .github/workflows/release.yml package.json src-tauri/tauri.conf.json docs/release-notes/v3.16.4-11-zh.md memory.md; pnpm dlx js-yaml .github/workflows/release.yml; cargo metadata --manifest-path src-tauri/Cargo.toml --no-deps --format-version 1; pnpm typecheck; git diff --check only reported the existing Cargo.lock CRLF warning.
1 parent 5777c70 commit 8e93cd6

7 files changed

Lines changed: 50 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,19 @@ jobs:
769769
set -euxo pipefail
770770
TAG="${GITHUB_REF_NAME}"
771771
mkdir -p dl
772-
gh release download "$TAG" --dir dl --repo "$GITHUB_REPOSITORY"
772+
for attempt in 1 2 3 4 5 6; do
773+
rm -rf dl/*
774+
if gh release download "$TAG" --dir dl --repo "$GITHUB_REPOSITORY"; then
775+
break
776+
fi
777+
if [ "$attempt" -eq 6 ]; then
778+
echo "Failed to download release assets for $TAG after $attempt attempts" >&2
779+
exit 1
780+
fi
781+
sleep_seconds=$((attempt * 20))
782+
echo "Release asset download failed, retrying in ${sleep_seconds}s..."
783+
sleep "$sleep_seconds"
784+
done
773785
ls -la dl || true
774786
- name: Generate latest.json
775787
env:
@@ -857,4 +869,15 @@ jobs:
857869
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
858870
run: |
859871
set -euxo pipefail
860-
gh release upload "$GITHUB_REF_NAME" latest.json --clobber --repo "$GITHUB_REPOSITORY"
872+
for attempt in 1 2 3 4 5 6; do
873+
if gh release upload "$GITHUB_REF_NAME" latest.json --clobber --repo "$GITHUB_REPOSITORY"; then
874+
exit 0
875+
fi
876+
if [ "$attempt" -eq 6 ]; then
877+
echo "Failed to upload latest.json after $attempt attempts" >&2
878+
exit 1
879+
fi
880+
sleep_seconds=$((attempt * 20))
881+
echo "latest.json upload failed, retrying in ${sleep_seconds}s..."
882+
sleep "$sleep_seconds"
883+
done
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# CCSwitchMulti v3.16.4-11 发布说明
2+
3+
本版本补齐上一轮 GitHub Release 的 updater 元数据稳定性。
4+
5+
## 修复
6+
7+
- 保留 `v3.16.4-10` 已验证成功的 macOS 未签名 DMG 发布路径:未配置 Apple 签名和公证凭据时,Release 仍会上传 `CC-Switch-v3.16.4-11-macOS.dmg`
8+
- 修复 `latest.json` 组装阶段对 GitHub Release 资产接口 503 过于敏感的问题。下载 release 资产和上传 `latest.json` 都增加有限重试,避免资产已经上传成功但 updater 元数据缺失。
9+
- Release 下载说明继续明确:macOS DMG 在缺少 Apple 签名配置时是未签名版本;后续补齐 Apple Developer ID 证书和 notarization secrets 后会自动切换为签名并公证的 DMG。
10+
11+
## 验证重点
12+
13+
- `v3.16.4-10` 的 release run 已证明 unsigned macOS DMG 会进入 Release 资产列表,但同 run 因 GitHub asset API 503 未能生成 `latest.json`
14+
- 本版本用于验证正式 release 同时具备 macOS DMG、macOS updater tarball、Windows/Linux 多架构资产和 `latest.json`

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 GitHub Release latest.json Retry Boundary
4+
5+
- `v3.16.4-10` 验证了 unsigned macOS DMG fallback 是有效的:Release 资产已包含 `CC-Switch-v3.16.4-10-macOS.dmg``macOS.tar.gz``.sig``macOS.zip`,说明 macOS build 和 `Prepare macOS Assets` 修复没有问题。
6+
- 同一 run `28613873120` 最终失败在 `Assemble latest.json``Download all release assets``gh release download v3.16.4-10` 调 GitHub asset API 时返回 HTTP 503,导致 `latest.json` 没生成。这个失败点发生在资产上传之后,所以 Release 看起来可下载但缺 updater 元数据。
7+
- 修复边界:`assemble-latest-json` 不能单次依赖 GitHub release asset API;下载全部 release 资产和上传 `latest.json` 都要有限重试,失败时保留明确错误。不要把这种 503 误判成 macOS DMG fallback 失败。
8+
- 后续发布应推进新 tag 覆盖半成功 release,而不是只手工给旧 release 补 `latest.json`;否则 workflow 本身仍会在下一次 GitHub API 抖动时复发。
9+
310
## 2026-07-03 macOS Unsigned DMG Release Fallback
411

512
- `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。

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-10",
3+
"version": "3.16.4-11",
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-10"
3+
version = "3.16.4-11"
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-10",
4+
"version": "3.16.4-11",
55
"identifier": "com.ccswitchmulti.desktop",
66
"build": {
77
"frontendDist": "../dist",

0 commit comments

Comments
 (0)