Files
jasp-desktop-bin/scripts/push-aur.sh
T
agw 0d4db32d5c
Build JASP binary and publish to AUR / check (push) Successful in 10s
Build JASP binary and publish to AUR / build (push) Failing after 12s
Automated Arch binary builds of JASP for the AUR
Upstream JASP ships no Linux binary, so the existing AUR package builds
everything from source including several hundred R packages. This builds
that once in CI and publishes the result as jasp-desktop-bin.

JASP links against the system R and Qt6 rather than bundling them, so a
rebuild is triggered by an Arch r/qt6-base bump as well as by a new JASP
release, and the generated PKGBUILD pins depends to the versions actually
built against.
2026-09-01 20:30:00 +02:00

51 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
# Publish the generated PKGBUILD to the AUR.
#
# AUR_SSH_KEY private key registered with aur.archlinux.org (required)
# $1 path to the generated PKGBUILD
#
# .SRCINFO is generated with makepkg inside an Arch container, because makepkg
# does not exist on the Ubuntu runner image.
set -euo pipefail
PKGBUILD_PATH="${1:?path to PKGBUILD is required}"
: "${AUR_SSH_KEY:?AUR_SSH_KEY is required}"
PKGNAME="${PKGNAME:-jasp-desktop-bin}"
workdir="$(mktemp -d)"
trap 'rm -rf "$workdir"' EXIT
install -m600 /dev/stdin "$workdir/aur_key" <<<"$AUR_SSH_KEY"
export GIT_SSH_COMMAND="ssh -i $workdir/aur_key -o IdentitiesOnly=yes -o StrictHostKeyChecking=accept-new"
echo ":: cloning AUR repo $PKGNAME"
# A package that does not exist yet clones as an empty repo, which is fine.
git clone "ssh://aur@aur.archlinux.org/${PKGNAME}.git" "$workdir/aur"
cp "$PKGBUILD_PATH" "$workdir/aur/PKGBUILD"
echo ":: generating .SRCINFO"
docker run --rm -v "$workdir/aur:/pkg" -w /pkg archlinux:base-devel bash -euc '
useradd -m builder
chown -R builder /pkg
sudo -u builder makepkg --printsrcinfo > /pkg/.SRCINFO
'
cd "$workdir/aur"
git config user.name "${AUR_GIT_NAME:-JASP bin autobuilder}"
git config user.email "${AUR_GIT_EMAIL:-noreply@weircon.dk}"
if git diff --quiet && git diff --cached --quiet && [[ -z "$(git status --porcelain)" ]]; then
echo ":: AUR already up to date, nothing to push"
exit 0
fi
version="$(awk -F= '/^pkgver=/{v=$2} /^pkgrel=/{r=$2} END{print v"-"r}' PKGBUILD)"
git add PKGBUILD .SRCINFO
git commit -m "Update to ${version}"
git push origin HEAD:master
echo ":: pushed ${PKGNAME} ${version} to the AUR"