Internal
Public Access
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:
@@ -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
|
||||
|
||||
@@ -14,12 +14,6 @@ if [[ ! -f "$BUILD_DIR/CMakeCache.txt" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VERSION="$(sed -n 's/^CMAKE_PROJECT_VERSION:STATIC=//p' "$BUILD_DIR/CMakeCache.txt" | head -n1)"
|
||||
if [[ -z "$VERSION" ]]; then
|
||||
echo "Unable to determine project version from $BUILD_DIR/CMakeCache.txt" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
MACDEPLOYQT="$(brew --prefix qt@6)/bin/macdeployqt"
|
||||
if [[ ! -x "$MACDEPLOYQT" ]]; then
|
||||
echo "macdeployqt not found at $MACDEPLOYQT" >&2
|
||||
@@ -31,7 +25,17 @@ mkdir -p "$DIST_DIR"
|
||||
rm -rf "$STAGE_DIR" "$INSTALL_PREFIX"
|
||||
mkdir -p "$STAGE_DIR"
|
||||
|
||||
# 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)"
|
||||
if [[ -z "$VERSION" ]]; then
|
||||
echo "Unable to determine project version from $BUILD_DIR/CMakeCache.txt" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cmake --install "$BUILD_DIR" --prefix "$INSTALL_PREFIX"
|
||||
|
||||
if [[ ! -d "$INSTALL_PREFIX/$APP_BUNDLE" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user