build: use sparse domestic Cargo index on JD

This commit is contained in:
冰朔 2026-07-17 19:21:48 +08:00
parent 11e5ac0fb2
commit 86447ae197

View File

@ -27,6 +27,8 @@ if ! command -v cargo >/dev/null 2>&1; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
fi
export PATH="$HOME/.cargo/bin:$PATH"
export CARGO_REGISTRIES_CRATES_IO_PROTOCOL="${CARGO_REGISTRIES_CRATES_IO_PROTOCOL:-sparse}"
export CARGO_REGISTRIES_CRATES_IO_INDEX="${CARGO_REGISTRIES_CRATES_IO_INDEX:-sparse+https://rsproxy.cn/index/}"
if ! command -v corepack >/dev/null 2>&1; then
npm install --global corepack