🐛 fix(workflow): 为 Cargo 配置 crates 镜像源

- 在安装 Rust 步骤写入 ~/.cargo/config.toml,将 crates-io 切换到 rsproxy sparse registry
- 避免 runner 访问 index.crates.io 超时导致依赖下载失败
- 与 rustup 镜像配置配合,统一走国内镜像完成工具链和依赖安装
This commit is contained in:
2026-05-26 20:34:23 +08:00
parent a79ef99500
commit 7e8d4baac6

View File

@@ -80,6 +80,14 @@ jobs:
echo "使用 Rust 构建目标: $BUILD_TARGET"
rustc -V
cargo -V
mkdir -p "$HOME/.cargo"
cat >"$HOME/.cargo/config.toml" <<'EOF'
[source.crates-io]
replace-with = "rsproxy-sparse"
[source.rsproxy-sparse]
registry = "sparse+https://rsproxy.cn/index/"
EOF
- name: 构建发布包
env: