Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/scripts/prune-runner-apt-sources.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
#
# GitHub's Ubuntu runner images preinstall Microsoft's apt repositories (azure-cli and the
# packages.microsoft.com prod repo). Wails uses neither, and when that host serves a 403 for
# them - see https://github.com/wailsapp/wails/issues/6040 - `apt-get update` fails and takes
# the whole job down with it. Dropping the two list files makes our CI independent of it.
#
# Only do this on ephemeral GitHub-hosted VMs. On a self-hosted runner, or on a developer's
# machine running these workflows locally with `act`, /etc/apt belongs to the host: deleting
# real apt sources there is destructive and not something a CI job should do.
set -euo pipefail

if [ "${ACT:-}" = "true" ] || [ "${RUNNER_ENVIRONMENT:-}" != "github-hosted" ]; then
echo "Leaving apt sources untouched (ACT=${ACT:-unset}, RUNNER_ENVIRONMENT=${RUNNER_ENVIRONMENT:-unset})."
exit 0
fi

sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list /etc/apt/sources.list.d/azure-cli.list
4 changes: 4 additions & 0 deletions .github/workflows/build-and-test-v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ jobs:
- name: Install linux dependencies (GTK4 default)
if: matrix.os == 'ubuntu-latest'
run: |
# Drop the runner image's unused Microsoft apt repos (no-op off GitHub-hosted runners).
./.github/scripts/prune-runner-apt-sources.sh
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends libgtk-4-dev libwebkitgtk-6.0-dev libwayland-dev build-essential pkg-config xvfb x11-xserver-utils at-spi2-core xdg-desktop-portal-gtk

Expand Down Expand Up @@ -219,6 +221,8 @@ jobs:
- name: Install linux dependencies (GTK4 default)
if: matrix.os == 'ubuntu-latest'
run: |
# Drop the runner image's unused Microsoft apt repos (no-op off GitHub-hosted runners).
./.github/scripts/prune-runner-apt-sources.sh
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends libgtk-4-dev libwebkitgtk-6.0-dev libwayland-dev build-essential pkg-config

Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@ jobs:
- name: Install apt packages (ubuntu-22.04)
if: matrix.os == 'ubuntu-22.04'
run: |
# Drop the runner image's unused Microsoft apt repos (no-op off GitHub-hosted runners).
./.github/scripts/prune-runner-apt-sources.sh
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config

- name: Install apt packages (ubuntu-24.04)
if: matrix.os == 'ubuntu-24.04'
run: |
# Drop the runner image's unused Microsoft apt repos (no-op off GitHub-hosted runners).
./.github/scripts/prune-runner-apt-sources.sh
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config libegl1

Expand Down Expand Up @@ -130,6 +134,8 @@ jobs:
- name: Install apt packages (ubuntu-22.04)
if: matrix.os == 'ubuntu-22.04'
run: |
# Drop the runner image's unused Microsoft apt repos (no-op off GitHub-hosted runners).
./.github/scripts/prune-runner-apt-sources.sh
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config

Expand All @@ -140,6 +146,8 @@ jobs:
- name: Install apt packages (ubuntu-24.04)
if: matrix.os == 'ubuntu-24.04'
run: |
# Drop the runner image's unused Microsoft apt repos (no-op off GitHub-hosted runners).
./.github/scripts/prune-runner-apt-sources.sh
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config libegl1

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-cross-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ jobs:

- name: Install Linux dev dependencies
run: |
# Drop the runner image's unused Microsoft apt repos (no-op off GitHub-hosted runners).
./.github/scripts/prune-runner-apt-sources.sh
sudo apt-get update
sudo apt-get install -y libgtk-4-dev libwebkitgtk-6.0-dev libgtk-3-dev libwebkit2gtk-4.1-dev libwayland-dev

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/cross-compile-test-v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ jobs:

- name: Install Linux dependencies
run: |
# Drop the runner image's unused Microsoft apt repos (no-op off GitHub-hosted runners).
./.github/scripts/prune-runner-apt-sources.sh
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends libgtk-4-dev libwebkitgtk-6.0-dev libgtk-3-dev libwebkit2gtk-4.1-dev libwayland-dev build-essential pkg-config

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pr-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,16 @@ jobs:
- name: Install linux dependencies (22.04)
if: matrix.os == 'ubuntu-22.04'
run: |
# Drop the runner image's unused Microsoft apt repos (no-op off GitHub-hosted runners).
./.github/scripts/prune-runner-apt-sources.sh
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config

- name: Install linux dependencies (24.04)
if: matrix.os == 'ubuntu-24.04'
run: |
# Drop the runner image's unused Microsoft apt repos (no-op off GitHub-hosted runners).
./.github/scripts/prune-runner-apt-sources.sh
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config

Expand Down
Loading