chore: switch all mirrors to Aliyun (APT, PyPI, Maven/Gradle)
This commit is contained in:
parent
f46365a317
commit
f066e4bdb1
@ -22,17 +22,36 @@ jobs:
|
||||
- name: Install dependencies (CN mirror)
|
||||
run: |
|
||||
set -e
|
||||
# 替换 Debian/Ubuntu 源为腾讯云镜像
|
||||
# 替换 Debian/Ubuntu 源为阿里云镜像
|
||||
for f in /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources; do
|
||||
[ -f "$f" ] || continue
|
||||
sed -i -E 's|https?://deb.debian.org|http://mirrors.cloud.tencent.com|g' "$f" || true
|
||||
sed -i -E 's|https?://security.debian.org|http://mirrors.cloud.tencent.com/debian-security|g' "$f" || true
|
||||
sed -i -E 's|https?://deb.debian.org|http://mirrors.aliyun.com|g' "$f" || true
|
||||
sed -i -E 's|https?://security.debian.org|http://mirrors.aliyun.com/debian-security|g' "$f" || true
|
||||
sed -i -E 's|https?://archive.ubuntu.com|http://mirrors.aliyun.com|g' "$f" || true
|
||||
sed -i -E 's|https?://ports.ubuntu.com|http://mirrors.aliyun.com|g' "$f" || true
|
||||
done
|
||||
apt-get -o Acquire::Check-Valid-Until=false update -y
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends git ca-certificates python3 python3-pip rsync
|
||||
pip3 install --break-system-packages python-dotenv requests -i https://mirrors.cloud.tencent.com/pypi/simple
|
||||
pip3 install --break-system-packages python-dotenv requests -i https://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
- name: Configure Gradle mirror (Aliyun)
|
||||
run: |
|
||||
mkdir -p ~/.gradle
|
||||
cat > ~/.gradle/init.gradle << 'EOF'
|
||||
allprojects {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||
maven { url 'https://maven.aliyun.com/repository/spring' }
|
||||
maven { url 'https://maven.aliyun.com/repository/spring-plugin' }
|
||||
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
EOF
|
||||
echo "✅ Gradle configured to use Aliyun mirror"
|
||||
|
||||
- name: Checkout code
|
||||
run: |
|
||||
git config --global --add safe.directory ${{ github.workspace }}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user