fix(ci): add fallback Ubuntu package mirrors (#9864)

This commit is contained in:
maria authored and GitHub committed 2026-09-04 19:16:49 -07:00
1 parent 57a6b70e24
commit 4ade365180
3 files changed
+31

No files matched your search

@@ -0,0 +1,22 @@
name: Setup APT mirrors
description: Configure Ubuntu package downloads with automatic mirror failover.
runs:
using: composite
steps:
- shell: bash
run: |
# Replace the existing Blacksmith mirror list as well as direct sources.
printf '%s\tpriority:%s\n' \
https://archive.ubuntu.com/ubuntu 1 \
https://mirrors.edge.kernel.org/ubuntu 2 \
https://mirror.math.princeton.edu/pub/ubuntu 3 \
| sudo tee /etc/apt/blacksmith-ubuntu-mirrors.txt > /dev/null
# APT's mirror transport retries each file against the next server.
sudo find /etc/apt -maxdepth 2 -type f \( -name '*.list' -o -name '*.sources' \) \
-exec sed -i -E \
's#https?://(([^/]+\.)?archive|security)\.ubuntu\.com/ubuntu/?#mirror+file:/etc/apt/blacksmith-ubuntu-mirrors.txt#g' {} +
# Move on to a fallback before an unreachable server exhausts the job.
printf '%s\n' 'Acquire::http::Timeout "15";' 'Acquire::https::Timeout "15";' \
| sudo tee /etc/apt/apt.conf.d/80-mirror-timeouts > /dev/null
+4
View File
@@ -51,6 +51,8 @@ jobs:
- name: Typecheck
run: vpr typecheck
- uses: ./.github/actions/setup-apt-mirrors
- name: Install browser secret helper build libraries
run: |
sudo sed -i 's|http://|https://|g' /etc/apt/blacksmith-ubuntu-mirrors.txt /etc/apt/sources.list.d/ubuntu.sources
@@ -90,6 +92,8 @@ jobs:
- name: Ensure Electron runtime is installed
run: vp run --filter @t3tools/desktop ensure:electron
- uses: ./.github/actions/setup-apt-mirrors
- name: Install browser secret helper build libraries
run: |
sudo sed -i 's|http://|https://|g' /etc/apt/blacksmith-ubuntu-mirrors.txt /etc/apt/sources.list.d/ubuntu.sources
+5
View File
@@ -216,6 +216,8 @@ jobs:
- name: Typecheck
run: vp run typecheck
- uses: ./.github/actions/setup-apt-mirrors
- name: Install browser secret helper build libraries
run: sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config
@@ -527,6 +529,9 @@ jobs:
exit $code
}
- uses: ./.github/actions/setup-apt-mirrors
if: matrix.platform == 'linux'
- name: Install Linux desktop build libraries
if: matrix.platform == 'linux'
shell: bash