TypeScript
fix(ci): add fallback Ubuntu package mirrors (#9864)
maria4ade36518023
diff --git a/.github/actions/setup-apt-mirrors/action.yml b/.github/actions/setup-apt-mirrors/action.ymlnew file mode 100644index 00000000000..5beff201d18--- /dev/null+++ b/.github/actions/setup-apt-mirrors/action.yml@@ -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/nulldiff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex fba55f53aaf..6c0866fa63a 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -51,6 +51,8 @@ jobs:- name: Typecheckrun: vpr typecheck+ - uses: ./.github/actions/setup-apt-mirrors+- name: Install browser secret helper build librariesrun: |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 installedrun: vp run --filter @t3tools/desktop ensure:electron+ - uses: ./.github/actions/setup-apt-mirrors+- name: Install browser secret helper build librariesrun: |sudo sed -i 's|http://|https://|g' /etc/apt/blacksmith-ubuntu-mirrors.txt /etc/apt/sources.list.d/ubuntu.sourcesdiff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 404e4e8075c..517a2fdb2ad 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -216,6 +216,8 @@ jobs:- name: Typecheckrun: vp run typecheck+ - uses: ./.github/actions/setup-apt-mirrors+- name: Install browser secret helper build librariesrun: 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 librariesif: matrix.platform == 'linux'shell: bash