packaging: read project version after building, not before

build-deb.sh and build-dmg.sh both read VERSION from CMakeCache.txt
before calling cmake --build -- but that build step is exactly what
reconfigures CMakeCache.txt if CMakeLists.txt changed since the build
dir was last configured. If the version was bumped and the script is
run without an explicit reconfigure first, it silently packages the
stale version (observed: v2026.9.15's macOS build produced
OrbitHub-2026.9.14.2.dmg). Move the VERSION read to after the build.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 06:26:15 -06:00
co-authored by Claude Sonnet 5
parent df99c78998
commit 4f5cf8ecd9
2 changed files with 15 additions and 7 deletions
+5 -1
View File
@@ -17,6 +17,11 @@ mkdir -p "$DIST_DIR"
rm -rf "$STAGE_DIR"
mkdir -p "$PKG_ROOT/DEBIAN"
# Read VERSION only after the build (which reconfigures CMakeCache.txt if
# CMakeLists.txt changed since the build dir was last configured) --
# reading it beforehand risks packaging a stale version string.
cmake --build "$BUILD_DIR" -j
VERSION="$(sed -n 's/^CMAKE_PROJECT_VERSION:STATIC=//p' "$BUILD_DIR/CMakeCache.txt" | head -n1)"
ARCH="$(dpkg --print-architecture)"
@@ -25,7 +30,6 @@ if [[ -z "$VERSION" ]]; then
exit 1
fi
cmake --build "$BUILD_DIR" -j
cmake --install "$BUILD_DIR" --prefix "$PKG_ROOT/usr"
cat > "$PKG_ROOT/DEBIAN/control" <<EOF