From 3c51f9028693aee8ca5b5e4a3ba664effa8045f1 Mon Sep 17 00:00:00 2001 From: chenwj113 Date: Wed, 21 Aug 2024 16:07:22 +0800 Subject: [PATCH] =?UTF-8?q?=20=E6=9B=B4=E6=94=B9rustup=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- action.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 55a7bca..6c74267 100644 --- a/action.yml +++ b/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