Skip to content

Commit b058c39

Browse files
committed
chore(release): prepare v5.0.1
1 parent 5a8d227 commit b058c39

File tree

9 files changed

+194
-8
lines changed

9 files changed

+194
-8
lines changed

.github/workflows/release.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,27 @@ jobs:
161161
ls -R artifacts/
162162
163163
- name: Install minisign
164+
shell: bash
164165
run: |
165-
sudo apt-get update
166-
sudo apt-get install -y --no-install-recommends minisign
166+
set -euxo pipefail
167+
MINISIGN_VERSION="0.12"
168+
case "$(uname -m)" in
169+
x86_64|amd64) MINISIGN_ARCH="x86_64" ;;
170+
aarch64|arm64) MINISIGN_ARCH="aarch64" ;;
171+
*)
172+
echo "Unsupported minisign architecture: $(uname -m)" >&2
173+
exit 1
174+
;;
175+
esac
176+
177+
curl -fsSL \
178+
"https://github.com/jedisct1/minisign/releases/download/${MINISIGN_VERSION}/minisign-${MINISIGN_VERSION}-linux.tar.gz" \
179+
-o /tmp/minisign.tar.gz
180+
tar -xzf /tmp/minisign.tar.gz -C /tmp
181+
sudo install -m 0755 \
182+
"/tmp/minisign-linux/${MINISIGN_ARCH}/minisign" \
183+
/usr/local/bin/minisign
184+
minisign -v
167185
168186
- name: Prepare release assets
169187
run: |

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ vitest-report.json
2424
/blog
2525
*.bak
2626
skill.md
27-
scripts/
27+
scripts/*
28+
!scripts/generate_latest_json.py
2829

2930
.agent/
3031
.agents/

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,34 @@ All notable changes to CC Switch CLI will be documented in this file.
77
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
88
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
99

10+
## [5.0.1] - 2026-03-15
11+
12+
### Added
13+
14+
- **Claude / Codex (TUI)**: Add first-switch safety prompts that detect existing live configs, offer import-before-overwrite, and show a one-time common-config tip after the first real provider switch.
15+
16+
### Fixed
17+
18+
- **Update**: Align self-update target resolution with upstream release metadata, harden signed self-update and installer upgrades, and avoid noisy archive extraction locale issues in the install script.
19+
- **TUI**: Preserve the v5 palette across terminal capabilities, including ansi256 fallback paths such as Apple Terminal compatibility mode.
20+
- **Codex**: Allow importing the current live config when `config.toml` exists without `auth.json`, while still avoiding first-use prompts for auth-only states.
21+
22+
### Docs
23+
24+
- **README**: Refresh the version badges and add a short 5.0.1 highlights section in both English and Chinese docs.
25+
26+
### Commits (since v5.0.0)
27+
28+
- 3ee87c4 fix: align update flow with upstream release resolution
29+
- a0ebe7f fix(tui): preserve v5 colors across terminal capabilities
30+
- 060cd7a fix(update): harden signed self-update and installer upgrades
31+
- d3ff0a7 feat(tui): add Claude provider switch safety prompts
32+
- 5a8d227 feat(tui): add Codex provider switch safety prompts
33+
34+
### Thanks
35+
36+
- Thanks `@saladday` for the 5.0.1 self-update hardening, terminal color compatibility work, and Claude/Codex switch safety UX.
37+
1038
## [5.0.0] - 2026-03-13
1139

1240
### Added

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# CC-Switch CLI
44

5-
[![Version](https://img.shields.io/badge/version-5.0.0-blue.svg)](https://github.com/saladday/cc-switch-cli/releases)
5+
[![Version](https://img.shields.io/badge/version-5.0.1-blue.svg)](https://github.com/saladday/cc-switch-cli/releases)
66
[![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-lightgrey.svg)](https://github.com/saladday/cc-switch-cli/releases)
77
[![Built with Rust](https://img.shields.io/badge/built%20with-Rust-orange.svg)](https://www.rust-lang.org/)
88
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
@@ -28,6 +28,14 @@ This project is a **CLI fork** of [CC-Switch](https://github.com/farion1231/cc-s
2828

2929
---
3030

31+
## 🆕 What's New in 5.0.1
32+
33+
- Self-update now follows GitHub release metadata more closely and has a safer signed upgrade path.
34+
- The v5 TUI palette now stays readable across Apple Terminal and ansi256 compatibility modes.
35+
- Claude and Codex now warn before a first switch would overwrite an existing live config, and show a one-time common-config tip after the first real provider change.
36+
37+
---
38+
3139
## ❤️ Sponsor
3240

3341
<table>

README_ZH.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# CC-Switch CLI
44

5-
[![Version](https://img.shields.io/badge/version-5.0.0-blue.svg)](https://github.com/saladday/cc-switch-cli/releases)
5+
[![Version](https://img.shields.io/badge/version-5.0.1-blue.svg)](https://github.com/saladday/cc-switch-cli/releases)
66
[![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-lightgrey.svg)](https://github.com/saladday/cc-switch-cli/releases)
77
[![Built with Rust](https://img.shields.io/badge/built%20with-Rust-orange.svg)](https://www.rust-lang.org/)
88
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
@@ -26,6 +26,14 @@
2626

2727
---
2828

29+
## 🆕 5.0.1 更新内容
30+
31+
- 自更新流程进一步对齐 GitHub Release 元数据,签名升级和安装脚本升级路径更稳妥。
32+
- v5 TUI 配色在 Apple Terminal 和 ansi256 兼容模式下保持可读且一致。
33+
- Claude 与 Codex 在第一次切换可能覆盖现有 live 配置时会先提示,并在第一次真实切换后显示一次性“通用配置”提示。
34+
35+
---
36+
2937
## ❤️赞助商
3038

3139
<table>

scripts/generate_latest_json.py

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
#!/usr/bin/env python3
2+
3+
import json
4+
import sys
5+
from pathlib import Path
6+
7+
8+
def asset_entry(release_dir: Path, base_url: str, filename: str):
9+
return {
10+
"url": f"{base_url}/{filename}",
11+
"signature": (release_dir / f"{filename}.minisig")
12+
.read_text(encoding="utf-8")
13+
.strip(),
14+
}
15+
16+
17+
def file_exists(release_dir: Path, filename: str) -> bool:
18+
return (release_dir / filename).is_file() and (
19+
release_dir / f"{filename}.minisig"
20+
).is_file()
21+
22+
23+
def add_mac_platforms(manifest: dict, release_dir: Path, base_url: str):
24+
universal = "cc-switch-cli-darwin-universal.tar.gz"
25+
x64 = "cc-switch-cli-darwin-x64.tar.gz"
26+
arm64 = "cc-switch-cli-darwin-arm64.tar.gz"
27+
28+
if file_exists(release_dir, x64):
29+
manifest["platforms"]["darwin-x86_64"] = asset_entry(release_dir, base_url, x64)
30+
elif file_exists(release_dir, universal):
31+
manifest["platforms"]["darwin-x86_64"] = asset_entry(
32+
release_dir, base_url, universal
33+
)
34+
35+
if file_exists(release_dir, arm64):
36+
manifest["platforms"]["darwin-aarch64"] = asset_entry(
37+
release_dir, base_url, arm64
38+
)
39+
elif file_exists(release_dir, universal):
40+
manifest["platforms"]["darwin-aarch64"] = asset_entry(
41+
release_dir, base_url, universal
42+
)
43+
44+
45+
def add_linux_platform(
46+
manifest: dict,
47+
release_dir: Path,
48+
base_url: str,
49+
platform_key: str,
50+
musl_name: str,
51+
glibc_name: str,
52+
):
53+
if file_exists(release_dir, musl_name):
54+
entry: dict[str, object] = dict(asset_entry(release_dir, base_url, musl_name))
55+
if file_exists(release_dir, glibc_name):
56+
entry["variants"] = {
57+
"glibc": asset_entry(release_dir, base_url, glibc_name),
58+
}
59+
manifest["platforms"][platform_key] = entry
60+
return
61+
62+
if file_exists(release_dir, glibc_name):
63+
manifest["platforms"][platform_key] = asset_entry(
64+
release_dir, base_url, glibc_name
65+
)
66+
67+
68+
def main() -> int:
69+
if len(sys.argv) != 6:
70+
print(
71+
"Usage: generate_latest_json.py <release_dir> <version> <pub_date> <base_url> <notes>",
72+
file=sys.stderr,
73+
)
74+
return 1
75+
76+
release_dir = Path(sys.argv[1]).resolve()
77+
version = sys.argv[2]
78+
pub_date = sys.argv[3]
79+
base_url = sys.argv[4].rstrip("/")
80+
notes = sys.argv[5]
81+
82+
manifest = {
83+
"version": version,
84+
"notes": notes,
85+
"pub_date": pub_date,
86+
"platforms": {},
87+
}
88+
89+
add_mac_platforms(manifest, release_dir, base_url)
90+
add_linux_platform(
91+
manifest,
92+
release_dir,
93+
base_url,
94+
"linux-x86_64",
95+
"cc-switch-cli-linux-x64-musl.tar.gz",
96+
"cc-switch-cli-linux-x64.tar.gz",
97+
)
98+
add_linux_platform(
99+
manifest,
100+
release_dir,
101+
base_url,
102+
"linux-aarch64",
103+
"cc-switch-cli-linux-arm64-musl.tar.gz",
104+
"cc-switch-cli-linux-arm64.tar.gz",
105+
)
106+
107+
windows = "cc-switch-cli-windows-x64.zip"
108+
if file_exists(release_dir, windows):
109+
manifest["platforms"]["windows-x86_64"] = asset_entry(
110+
release_dir, base_url, windows
111+
)
112+
113+
if not manifest["platforms"]:
114+
print("No signed release assets found to build latest.json", file=sys.stderr)
115+
return 1
116+
117+
output_path = release_dir / "latest.json"
118+
output_path.write_text(json.dumps(manifest, indent=2) + "\n", encoding="utf-8")
119+
return 0
120+
121+
122+
if __name__ == "__main__":
123+
raise SystemExit(main())

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 = "5.0.0"
3+
version = "5.0.1"
44
description = "All-in-One Assistant for Claude Code, Codex, Gemini & OpenCode CLI"
55
authors = ["Jason Young", "saladday"]
66
license = "MIT"

src-tauri/updater/minisign.pub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
untrusted comment: cc-switch-cli updater public key
2-
RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3
2+
RWQjbl+dz0AtG/FqYv8ipDCraaCRLPMS9YQB6QKcQMfx+w9KkaHiogyr

0 commit comments

Comments
 (0)