feat: add artifact caching to build process and improve error logging

This commit is contained in:
2026-04-27 14:21:15 +02:00
parent f29ef992a9
commit 47e8d717a6
4 changed files with 47 additions and 24 deletions
+14
View File
@@ -22,6 +22,20 @@ fi
mkdir -p "${ARTIFACTS_DIR}"
# Skip rebuild if artifacts for this version already exist
pkgver=$(bash -c "source ${SRC_DIR}/PKGBUILD; echo \${pkgver}")
pkgrel=$(bash -c "source ${SRC_DIR}/PKGBUILD; echo \${pkgrel}")
existing=$(find "${ARTIFACTS_DIR}" -maxdepth 1 \
-name "webkit2gtk-${pkgver}-${pkgrel}-*.pkg.tar.zst" \
! -name 'webkit2gtk-docs-*' \
-print | head -n1)
if [[ -n "${existing}" ]]; then
log "Artifacts for ${pkgver}-${pkgrel} already exist, skipping build"
log "Using cached: $(basename "${existing}")"
exit 0
fi
# Clean any leftover build artifacts from a previous run
log "Cleaning previous build artifacts in ${SRC_DIR}"
# makepkg leaves behind src/, pkg/ and the .pkg.tar.zst files