mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-19 04:56:30 +00:00
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:
@ -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 "$@"
|
||||
|
Reference in New Issue
Block a user