From 9f254b8c60dc1e6a68772e7320347d69e4e7b009 Mon Sep 17 00:00:00 2001 From: albertonoys <3334359+albertonoys@users.noreply.github.com> Date: Wed, 8 Jul 2026 14:37:06 +0200 Subject: [PATCH] fix(build): resolve AppImage version from manifest Reads version and commit directly from manifest.yaml for AppImage targets in Makefile and CI workflows. This prevents builds from defaulting to 'v0.0.0 (commit unknown)' when git commands fail or lack a git tree. Fixes #1596 --- .github/workflows/build-appimage.yaml | 6 +++++- .github/workflows/release.yml | 6 ++++-- Makefile | 5 +++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-appimage.yaml b/.github/workflows/build-appimage.yaml index 3ad5c95e25..dc8be108f0 100644 --- a/.github/workflows/build-appimage.yaml +++ b/.github/workflows/build-appimage.yaml @@ -45,9 +45,13 @@ jobs: - name: Configure CMake run: | + TAG=$(grep "tag:" manifest.yaml | cut -d'"' -f2) + COMMIT=$(grep "short_rev:" manifest.yaml | cut -d'"' -f2) cmake -S . -B build -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DVICINAE_GIT_TAG="$TAG" \ + -DVICINAE_GIT_COMMIT_HASH="$COMMIT" - name: Build run: cmake --build build --parallel $(nproc) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 85a068c1be..ed147feb45 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -144,14 +144,16 @@ jobs: - name: Configure CMake run: | + TAG=$(grep "tag:" manifest.yaml | cut -d'"' -f2) + COMMIT=$(grep "short_rev:" manifest.yaml | cut -d'"' -f2) cd build cmake -G Ninja .. \ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ -DVICINAE_PROVENANCE=appimage \ - -DVICINAE_GIT_TAG="${{ needs.build-binary.outputs.tag }}" \ - -DVICINAE_GIT_COMMIT_HASH="${{ needs.build-binary.outputs.commit }}" \ + -DVICINAE_GIT_TAG="$TAG" \ + -DVICINAE_GIT_COMMIT_HASH="$COMMIT" \ -DLTO=ON - name: Build diff --git a/Makefile b/Makefile index 5498ed24b4..261d102792 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,8 @@ BUILD_DIR := build BIN_DIR := build/bin RM := rm -TAG := $(shell git describe --tags --abbrev=0) +TAG := $(shell grep "tag:" manifest.yaml | cut -d'"' -f2) +COMMIT := $(shell grep "short_rev:" manifest.yaml | cut -d'"' -f2) APPIMAGE_BUILD_ENV_DIR := ./scripts/runners/appimage/ APPIMAGE_BUILD_ENV_IMAGE_TAG := vicinae/appimage-build-env FIGURA_CC := $(BIN_DIR)/figura @@ -96,7 +97,7 @@ portable: .PHONY: portable appimage: - cmake -G Ninja -DCMAKE_INSTALL_PREFIX=./build/install -DVICINAE_PROVENANCE=appimage -B $(BUILD_DIR) + cmake -G Ninja -DCMAKE_INSTALL_PREFIX=./build/install -DVICINAE_PROVENANCE=appimage -DVICINAE_GIT_TAG="$(TAG)" -DVICINAE_GIT_COMMIT_HASH="$(COMMIT)" -B $(BUILD_DIR) cmake --build $(BUILD_DIR) cmake --install $(BUILD_DIR) ./scripts/mkappimage.sh ./build/install AppDir