From 12d1b2657f573ec691f7b574582756c9a7cdba79 Mon Sep 17 00:00:00 2001 From: Christoph Brandau Date: Tue, 4 Aug 2026 20:19:20 +0200 Subject: [PATCH] fix(workflow): improve Arch Linux package installation process The workflow for building and publishing to Arch Linux has been updated to enhance the package installation process. This includes adding multiple mirror sources to ensure reliability and implementing retry logic for package installation attempts. - Removed dependency on the Windows publish job - Added backup mirrors for Arch Linux package management - Implemented retry logic for package installation failures --- .gitea/workflows/app_builder.yaml | 41 ++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/app_builder.yaml b/.gitea/workflows/app_builder.yaml index 5f980fd..0de9c0e 100644 --- a/.gitea/workflows/app_builder.yaml +++ b/.gitea/workflows/app_builder.yaml @@ -122,7 +122,6 @@ jobs: publish-arch: name: Build and publish gitty-desktop to AUR - needs: publish-windows runs-on: archlinux environment: production env: @@ -136,11 +135,42 @@ jobs: - name: Prepare Arch job container working-directory: / run: | - pacman -Syu --noconfirm - pacman -S --needed --noconfirm \ - base-devel curl git nodejs npm openssh rust \ - webkit2gtk-4.1 gtk3 hicolor-icon-theme \ + set -euo pipefail + + # The runner image may contain only a single geo mirror. Seed several + # currently active HTTPS mirrors and retain the image's list as a + # fallback so one slow CDN cannot fail the complete release. + ARCH_MIRROR_BACKUP="$(mktemp)" + cp /etc/pacman.d/mirrorlist "$ARCH_MIRROR_BACKUP" + printf '%s\n' \ + 'Server = https://frankfurt.mirror.pkgbuild.com/$repo/os/$arch' \ + 'Server = https://mirror.osbeck.com/archlinux/$repo/os/$arch' \ + 'Server = https://mirror.ubrco.de/archlinux/$repo/os/$arch' \ + 'Server = https://ftp.halifax.rwth-aachen.de/archlinux/$repo/os/$arch' \ + 'Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch' \ + > /etc/pacman.d/mirrorlist + sed -n '/^[[:space:]]*Server[[:space:]]*=/p' "$ARCH_MIRROR_BACKUP" \ + >> /etc/pacman.d/mirrorlist + + ARCH_PACKAGES=( + base-devel curl git nodejs npm openssh rust + webkit2gtk-4.1 gtk3 hicolor-icon-theme libappindicator-gtk3 librsvg xdotool + ) + + for ARCH_INSTALL_ATTEMPT in 1 2 3; do + echo "pacman attempt $ARCH_INSTALL_ATTEMPT of 3" + if pacman -Syu --needed --noconfirm "${ARCH_PACKAGES[@]}"; then + break + fi + + if [ "$ARCH_INSTALL_ATTEMPT" -eq 3 ]; then + echo "pacman failed after 3 attempts" >&2 + exit 1 + fi + + sleep "$((ARCH_INSTALL_ATTEMPT * 5))" + done - uses: actions/checkout@v5 with: @@ -219,7 +249,6 @@ jobs: publish-ubuntu: name: Build and publish Ubuntu AppImage - needs: publish-arch permissions: contents: write environment: production