packaging: stamp the pacman package with the version actually built
Desktop (Tauri) / Windows installer (cross-compiled) (push) Successful in 2m32s
Desktop (Tauri) / Tauri desktop (Linux) (push) Successful in 4m26s
Desktop (Tauri) / Update manifest (push) Successful in 4s

It read the version straight out of tauri.conf.json, which was correct until
dev builds started overriding the version on the command line — the file still
says 0.1.0, so release `dev` came out carrying a pacman package labelled 0.1.0
around a binary that reports 0.1.132.

Nothing breaks from it (a pacman install can't self-update anyway), but a
package that lies about its version is exactly what makes a later "which build
is this?" impossible to answer. Now uses the same build-version.sh the bundles
and the manifest do.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SreJkbxB4gx8pPsu8QbLPi
This commit is contained in:
2026-07-27 15:07:40 -04:00
co-authored by Claude Opus 5
parent 02c932260e
commit 3ca3eba6d5
+9 -6
View File
@@ -51,14 +51,17 @@ DEPENDS=(webkit2gtk-4.1 gtk3)
exit 1
}
# Single source of truth for the version: the same tauri.conf.json value the
# .deb and the AppImage are stamped with, so all three artifacts on a release
# always agree. Plain grep — jq is not guaranteed in the CI image.
# Single source of truth for the version: the SAME helper the bundle build uses.
#
# It used to read tauri.conf.json directly, which was right until dev builds began
# overriding the version on the command line (M10.9) — the file still says 0.1.0, so
# the pacman package came out stamped 0.1.0 around a binary reporting 0.1.132. A
# package that lies about its version is exactly what makes a later "which build is
# this?" question unanswerable.
# `|| true` so a miss falls through to the explicit error below rather than
# aborting on pipefail with no explanation.
PKGVER="$(grep -oE '"version"[[:space:]]*:[[:space:]]*"[^"]+"' "$SRC_TAURI/tauri.conf.json" |
head -1 | sed -E 's/.*"([^"]+)"$/\1/' || true)"
[ -n "$PKGVER" ] || { echo "ERROR: could not read version from tauri.conf.json" >&2; exit 1; }
PKGVER="$(sh "$SCRIPT_DIR/../build-version.sh" || true)"
[ -n "$PKGVER" ] || { echo "ERROR: could not determine the build version" >&2; exit 1; }
# Reproducible-ish: prefer the commit date over "now" so rebuilding the same
# commit produces the same builddate.