Compare commits
10 Commits
c0bc579c13
...
06a6da51ae
| Author | SHA1 | Date |
|---|---|---|
|
|
06a6da51ae | |
|
|
d636a77054 | |
|
|
220cf4854e | |
|
|
c54b2521ec | |
|
|
e3fcef5516 | |
|
|
bd0dd7428a | |
|
|
56311d6351 | |
|
|
672094484c | |
|
|
5b4ddd6a3e | |
|
|
3c51f90286 |
23
action.yml
23
action.yml
|
|
@ -106,6 +106,12 @@ runs:
|
|||
if [[ ! -v CARGO_REGISTRIES_CRATES_IO_PROTOCOL ]]; then
|
||||
echo "CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse" >> $GITHUB_ENV
|
||||
fi
|
||||
if [[ ! -v RUSTUP_DIST_SERVER ]]; then
|
||||
echo "RUSTUP_DIST_SERVER=https://rsproxy.cn" >> $GITHUB_ENV
|
||||
fi
|
||||
if [[ ! -v RUSTUP_UPDATE_ROOT ]]; then
|
||||
echo "RUSTUP_UPDATE_ROOT=https://rsproxy.cn/rustup" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Install Rust Problem Matcher
|
||||
if: inputs.matcher == 'true'
|
||||
|
|
@ -117,7 +123,7 @@ runs:
|
|||
shell: bash
|
||||
run: |
|
||||
if ! command -v rustup &> /dev/null ; then
|
||||
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
|
||||
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://rsproxy.cn/rustup-init.sh" | sh -s -- --default-toolchain none -y
|
||||
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
|
||||
fi
|
||||
|
||||
|
|
@ -146,6 +152,21 @@ runs:
|
|||
fi
|
||||
rustup toolchain install $toolchain${{steps.flags.outputs.targets}}${{steps.flags.outputs.components}} --profile minimal${{steps.flags.outputs.downgrade}} --no-self-update
|
||||
rustup override set $toolchain
|
||||
if [[ ! -f ~/.cargo/config ]]; then
|
||||
mkdir -p ~/.cargo
|
||||
touch ~/.cargo/config
|
||||
fi
|
||||
cat /dev/null > ~/.cargo/config
|
||||
echo "[source.crates-io]" > ~/.cargo/config
|
||||
echo "replace-with = 'rsproxy-sparse'" >> ~/.cargo/config
|
||||
echo "[source.rsproxy]" >> ~/.cargo/config
|
||||
echo "registry = 'https://rsproxy.cn/crates.io-index'" >> ~/.cargo/config
|
||||
echo "[source.rsproxy-sparse]" >> ~/.cargo/config
|
||||
echo "registry = 'sparse+https://rsproxy.cn/index/'" >> ~/.cargo/config
|
||||
echo "[registries.rsproxy]" >> ~/.cargo/config
|
||||
echo "index = 'https://rsproxy.cn/crates.io-index'" >> ~/.cargo/config
|
||||
echo "[net]" >> ~/.cargo/config
|
||||
echo "git-fetch-with-cli = true" >> ~/.cargo/config
|
||||
fi
|
||||
|
||||
- id: versions
|
||||
|
|
|
|||
Loading…
Reference in New Issue