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
This commit is contained in:
@@ -122,7 +122,6 @@ jobs:
|
|||||||
|
|
||||||
publish-arch:
|
publish-arch:
|
||||||
name: Build and publish gitty-desktop to AUR
|
name: Build and publish gitty-desktop to AUR
|
||||||
needs: publish-windows
|
|
||||||
runs-on: archlinux
|
runs-on: archlinux
|
||||||
environment: production
|
environment: production
|
||||||
env:
|
env:
|
||||||
@@ -136,11 +135,42 @@ jobs:
|
|||||||
- name: Prepare Arch job container
|
- name: Prepare Arch job container
|
||||||
working-directory: /
|
working-directory: /
|
||||||
run: |
|
run: |
|
||||||
pacman -Syu --noconfirm
|
set -euo pipefail
|
||||||
pacman -S --needed --noconfirm \
|
|
||||||
base-devel curl git nodejs npm openssh rust \
|
# The runner image may contain only a single geo mirror. Seed several
|
||||||
webkit2gtk-4.1 gtk3 hicolor-icon-theme \
|
# 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
|
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
|
- uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
@@ -219,7 +249,6 @@ jobs:
|
|||||||
|
|
||||||
publish-ubuntu:
|
publish-ubuntu:
|
||||||
name: Build and publish Ubuntu AppImage
|
name: Build and publish Ubuntu AppImage
|
||||||
needs: publish-arch
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
environment: production
|
environment: production
|
||||||
|
|||||||
Reference in New Issue
Block a user