ci: support both apt sources formats for mirror switching
Update the CI workflow to handle both the legacy sources.list format and the new ubuntu.sources format when switching to Tsinghua mirrors
This commit is contained in:
@@ -36,8 +36,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Install build tools
|
- name: Install build tools
|
||||||
run: |
|
run: |
|
||||||
|
if [ -f /etc/apt/sources.list.d/ubuntu.sources ]; then
|
||||||
|
sudo sed -i 's|http://archive.ubuntu.com/ubuntu|https://mirrors.tuna.tsinghua.edu.cn/ubuntu|g' /etc/apt/sources.list.d/ubuntu.sources
|
||||||
|
sudo sed -i 's|http://security.ubuntu.com/ubuntu|https://mirrors.tuna.tsinghua.edu.cn/ubuntu|g' /etc/apt/sources.list.d/ubuntu.sources
|
||||||
|
else
|
||||||
sudo sed -i 's|http://archive.ubuntu.com|https://mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list
|
sudo sed -i 's|http://archive.ubuntu.com|https://mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list
|
||||||
sudo sed -i 's|http://security.ubuntu.com|https://mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list
|
sudo sed -i 's|http://security.ubuntu.com|https://mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list
|
||||||
|
fi
|
||||||
sudo apt-get update && sudo apt-get install -y gcc
|
sudo apt-get update && sudo apt-get install -y gcc
|
||||||
|
|
||||||
- name: Download dependencies
|
- name: Download dependencies
|
||||||
|
|||||||
Reference in New Issue
Block a user