Compare commits

..

10 Commits

Author SHA1 Message Date
chenwj113 06a6da51ae fix: 2024-08-22 09:01:31 +08:00
chenwj113 d636a77054 fix: 2024-08-21 17:14:08 +08:00
chenwj113 220cf4854e fix: 2024-08-21 17:06:08 +08:00
chenwj113 c54b2521ec fix: 2024-08-21 17:01:12 +08:00
chenwj113 e3fcef5516 fix: 去除多余的配置项 2024-08-21 16:57:56 +08:00
chenwj113 bd0dd7428a fix: 更改cargo 配置文件的写入方式 2024-08-21 16:46:14 +08:00
chenwj113 56311d6351 fix: 2024-08-21 16:32:37 +08:00
chenwj113 672094484c fix: 2024-08-21 16:29:44 +08:00
chenwj113 5b4ddd6a3e fix: 更改action内容 2024-08-21 16:13:53 +08:00
chenwj113 3c51f90286 更改rustup脚本地址 2024-08-21 16:07:22 +08:00
1 changed files with 22 additions and 1 deletions

View File

@ -106,6 +106,12 @@ runs:
if [[ ! -v CARGO_REGISTRIES_CRATES_IO_PROTOCOL ]]; then if [[ ! -v CARGO_REGISTRIES_CRATES_IO_PROTOCOL ]]; then
echo "CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse" >> $GITHUB_ENV echo "CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse" >> $GITHUB_ENV
fi 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 - name: Install Rust Problem Matcher
if: inputs.matcher == 'true' if: inputs.matcher == 'true'
@ -117,7 +123,7 @@ runs:
shell: bash shell: bash
run: | run: |
if ! command -v rustup &> /dev/null ; then 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 echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
fi fi
@ -146,6 +152,21 @@ runs:
fi fi
rustup toolchain install $toolchain${{steps.flags.outputs.targets}}${{steps.flags.outputs.components}} --profile minimal${{steps.flags.outputs.downgrade}} --no-self-update 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 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 fi
- id: versions - id: versions