authorgravatar for maria@kuuro.netmaria <maria@kuuro.net> 2026-09-04 22:16:49-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-04 19:16:49-07:00
log4ade365180231983008bcd46ca7312f8155e1224
tree35fb25f2a2332882733584da1ba513513f1a6e56
parent57a6b70e24221f00c9a161f1e5b6b2ddd753bc8f
signature Signed by PGP key B5690EEEBB952194

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


3 files changed, 31 insertions(+), 0 deletions(-)

.github/actions/setup-apt-mirrors/action.yml created+22
...@@ -0,0 +1,22 @@
1name: Setup APT mirrors
2description: Configure Ubuntu package downloads with automatic mirror failover.
3runs:
4 using: composite
5 steps:
6 - shell: bash
7 run: |
8 # Replace the existing Blacksmith mirror list as well as direct sources.
9 printf '%s\tpriority:%s\n' \
10 https://archive.ubuntu.com/ubuntu 1 \
11 https://mirrors.edge.kernel.org/ubuntu 2 \
12 https://mirror.math.princeton.edu/pub/ubuntu 3 \
13 | sudo tee /etc/apt/blacksmith-ubuntu-mirrors.txt > /dev/null
14
15 # APT's mirror transport retries each file against the next server.
16 sudo find /etc/apt -maxdepth 2 -type f \( -name '*.list' -o -name '*.sources' \) \
17 -exec sed -i -E \
18 's#https?://(([^/]+\.)?archive|security)\.ubuntu\.com/ubuntu/?#mirror+file:/etc/apt/blacksmith-ubuntu-mirrors.txt#g' {} +
19
20 # Move on to a fallback before an unreachable server exhausts the job.
21 printf '%s\n' 'Acquire::http::Timeout "15";' 'Acquire::https::Timeout "15";' \
22 | sudo tee /etc/apt/apt.conf.d/80-mirror-timeouts > /dev/null
.github/workflows/ci.yml+4
...@@ -51,6 +51,8 @@ jobs:...@@ -51,6 +51,8 @@ jobs:
51 - name: Typecheck51 - name: Typecheck
52 run: vpr typecheck52 run: vpr typecheck
5353
54 - uses: ./.github/actions/setup-apt-mirrors
55
54 - name: Install browser secret helper build libraries56 - name: Install browser secret helper build libraries
55 run: |57 run: |
56 sudo sed -i 's|http://|https://|g' /etc/apt/blacksmith-ubuntu-mirrors.txt /etc/apt/sources.list.d/ubuntu.sources58 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:...@@ -90,6 +92,8 @@ jobs:
90 - name: Ensure Electron runtime is installed92 - name: Ensure Electron runtime is installed
91 run: vp run --filter @t3tools/desktop ensure:electron93 run: vp run --filter @t3tools/desktop ensure:electron
9294
95 - uses: ./.github/actions/setup-apt-mirrors
96
93 - name: Install browser secret helper build libraries97 - name: Install browser secret helper build libraries
94 run: |98 run: |
95 sudo sed -i 's|http://|https://|g' /etc/apt/blacksmith-ubuntu-mirrors.txt /etc/apt/sources.list.d/ubuntu.sources99 sudo sed -i 's|http://|https://|g' /etc/apt/blacksmith-ubuntu-mirrors.txt /etc/apt/sources.list.d/ubuntu.sources
.github/workflows/release.yml+5
...@@ -216,6 +216,8 @@ jobs:...@@ -216,6 +216,8 @@ jobs:
216 - name: Typecheck216 - name: Typecheck
217 run: vp run typecheck217 run: vp run typecheck
218218
219 - uses: ./.github/actions/setup-apt-mirrors
220
219 - name: Install browser secret helper build libraries221 - name: Install browser secret helper build libraries
220 run: sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config222 run: sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config
221223
...@@ -527,6 +529,9 @@ jobs:...@@ -527,6 +529,9 @@ jobs:
527 exit $code529 exit $code
528 }530 }
529531
532 - uses: ./.github/actions/setup-apt-mirrors
533 if: matrix.platform == 'linux'
534
530 - name: Install Linux desktop build libraries535 - name: Install Linux desktop build libraries
531 if: matrix.platform == 'linux'536 if: matrix.platform == 'linux'
532 shell: bash537 shell: bash