Skip to content

Commit

Permalink
Download mirror for specific country
Browse files Browse the repository at this point in the history
  • Loading branch information
FirelightFlagboy committed Jun 17, 2024
1 parent 02f3e90 commit 761c9eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,13 @@ jobs:
# see https://github.com/actions/runner-images/issues/7048
run: |
set -eux -o pipefail
COUNTRY=$(curl ipinfo.io | jq -r .country)

Check warning on line 60 in .github/workflows/ci-python.yml

View workflow job for this annotation

GitHub Actions / spelling / cspell

Unknown word (ipinfo)
MIRROR_FILE=$(mktemp)
curl "http://mirrors.ubuntu.com/$COUNTRY.txt" > $MIRROR_FILE
(
# make sure there is a `\t` between URL and `priority:*` attributes
printf 'http://azure.archive.ubuntu.com/ubuntu priority:1\n';
curl http://mirrors.ubuntu.com/mirrors.txt | grep https
grep -e '^https' $MIRROR_FILE
) | sudo tee /etc/apt/mirrors.txt
sudo sed -i 's/http:\/\/azure.archive.ubuntu.com\/ubuntu\//mirror+file:\/etc\/apt\/mirrors.txt/' /etc/apt/sources.list
Expand Down

0 comments on commit 761c9eb

Please sign in to comment.