From 9e8592883d164851547b29817ee8e3fe221753a2 Mon Sep 17 00:00:00 2001 From: Sarbian Date: Fri, 27 Nov 2026 13:26:19 +0100 Subject: [PATCH] Build on Ubuntu 24.04, without apt-key ubuntu-latest moved to Ubuntu 26.04, which no longer has apt-key, so the Mono install failed at its first step and every build since has failed, master included. The build job is pinned to ubuntu-24.04, the image the last passing build ran on: Mono's repository only publishes packages built for 20.04 (focal), known to install there. The repository's signing key now goes in its own keyring named by the source (signed-by), the way apt expects it, so moving to a newer image later only needs the pin. --- .github/workflows/build.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1e3ab7a..a283f87 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,7 +44,9 @@ defaults: jobs: build: - runs-on: ubuntu-latest + # Pinned: Mono's repository only has packages built for Ubuntu 20.04 (focal), known to install + # on 24.04. ubuntu-latest moved to 26.04, which also dropped apt-key. + runs-on: ubuntu-24.04 timeout-minutes: 20 permissions: contents: read @@ -60,11 +62,16 @@ jobs: # The project is a legacy (non-SDK) net471 csproj built with Mono's own MSBuild, exactly # like the old Jenkins job did (its "mono-msbuild" tool). Ubuntu's own mono-complete package # only ships the deprecated xbuild, not msbuild, so we pull Mono from the official repo. + # The signing key goes in its own keyring, named by the source (signed-by), as apt-key is + # gone from newer Ubuntu releases. - name: Install Mono run: | - sudo apt-get install -y -qq gnupg ca-certificates - sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF - echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list + sudo apt-get install -y -qq gnupg ca-certificates curl + sudo install -d -m 0755 /etc/apt/keyrings + curl -fsSL --retry 5 --retry-all-errors --retry-delay 5 \ + "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" \ + | sudo gpg --batch --yes --dearmor -o /etc/apt/keyrings/mono-official-stable.gpg + echo "deb [signed-by=/etc/apt/keyrings/mono-official-stable.gpg] https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list sudo apt-get update -qq sudo apt-get install -y -qq mono-devel nuget mono --version | head -1