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