From ecdb045bcb84e737f5043877d4b2973754276e7b Mon Sep 17 00:00:00 2001 From: Daniel Johnson Date: Sat, 6 Jun 2026 13:05:31 -0400 Subject: [PATCH] Default LUTRIS_VERSION from lutris/__init__.py in AppImage build Previously `make appimage` produced Lutris-dev-x86_64.AppImage unless the caller remembered to set LUTRIS_VERSION. On a tagged release commit that yielded a misleadingly-named artifact. Have build.sh awk the version out of lutris/__init__.py when no explicit value is provided; an env override (e.g. LUTRIS_VERSION=0.5.23-rc1 for a release candidate) still wins. Co-Authored-By: Claude Opus 4.7 --- utils/appimage/build.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/utils/appimage/build.sh b/utils/appimage/build.sh index e50284026..f0f6e60d9 100755 --- a/utils/appimage/build.sh +++ b/utils/appimage/build.sh @@ -14,6 +14,16 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)" IMAGE_TAG="lutris-appimage-builder:ubuntu22.04" +# Default LUTRIS_VERSION to whatever lutris/__init__.py advertises so a +# plain `make appimage` produces a sensibly-named artifact on a release +# commit. Explicit env override still wins (e.g. for RC tags). +if [ -z "${LUTRIS_VERSION:-}" ]; then + LUTRIS_VERSION="$(awk -F'"' '/^__version__/ { print $2; exit }' \ + "$REPO_ROOT/lutris/__init__.py")" +fi +: "${LUTRIS_VERSION:=dev}" +echo "Building Lutris AppImage version: $LUTRIS_VERSION" + if command -v docker >/dev/null 2>&1; then OCI=docker elif command -v podman >/dev/null 2>&1; then @@ -38,7 +48,7 @@ fi "$OCI" run --rm \ --privileged \ -v "$REPO_ROOT":/src${MOUNT_OPTS} \ - -e LUTRIS_VERSION="${LUTRIS_VERSION:-dev}" \ + -e LUTRIS_VERSION="$LUTRIS_VERSION" \ "$IMAGE_TAG" \ bash /src/utils/appimage/build-in-container.sh