ci: change rust src to crates-io-index while using GitHub workflow (#1023)

Signed-off-by: longjin <longjin@DragonOS.org>
This commit is contained in:
LoGin
2024-10-31 01:05:34 +08:00
committed by GitHub
parent f5b2038871
commit 7b0ef10895
3 changed files with 25 additions and 9 deletions

View File

@ -1,3 +1,19 @@
#!/bin/bash
CONFIG_FILE=~/.cargo/config.toml
change_rust_src_to_official() {
echo -e "[source.crates-io] \n \
registry = \"sparse+https://index.crates.io/\" \n \
[net] \n \
git-fetch-with-cli = true \n \
" > $CONFIG_FILE
}
# Check if the GITHUB_WORKFLOW environment variable is set and not empty
if [ -n "$GITHUB_ACTION" ]; then
change_rust_src_to_official
fi
exec "$@"