build: add AppImage packaging pipeline and build scripts

This commit is contained in:
dev 2026-03-04 11:08:29 +00:00
parent 7b4a9c1fe3
commit 26eaf8cf68
6 changed files with 220 additions and 0 deletions

View file

@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
IMAGE_NAME="${APPIMAGE_DOCKER_IMAGE:-scanslicer-appimage-builder}"
HOST_UID="${HOST_UID:-$(id -u)}"
HOST_GID="${HOST_GID:-$(id -g)}"
if ! command -v docker >/dev/null 2>&1; then
echo "Missing required command: docker" >&2
exit 1
fi
docker build \
-f "${ROOT_DIR}/packaging/appimage/Dockerfile" \
-t "${IMAGE_NAME}" \
"${ROOT_DIR}"
docker run --rm \
-e HOST_UID="${HOST_UID}" \
-e HOST_GID="${HOST_GID}" \
-v "${ROOT_DIR}:/work" \
-w /work \
--entrypoint bash \
"${IMAGE_NAME}" \
-lc 'set -euo pipefail; bash packaging/appimage/build-appimage.sh; if [ -d /work/appimage ]; then chown -R "${HOST_UID}:${HOST_GID}" /work/appimage; fi'
echo "Docker AppImage build complete. Output in ${ROOT_DIR}/appimage/dist"