diff --git a/.gitea/scripts/desktop-version.sh b/.gitea/scripts/desktop-version.sh new file mode 100755 index 0000000..a4ee88a --- /dev/null +++ b/.gitea/scripts/desktop-version.sh @@ -0,0 +1,53 @@ +#!/bin/sh +# desktop-version.sh -- Version aus dem letzten Freigabe-Tag in +# tauri.conf.json und Cargo.toml schreiben (Phase 18, D-07). +# +# Die Wahrheit der Client-Version ist der Freigabe-Tag (git describe), nicht +# eine im Repository eingecheckte Zahl -- dieses Skript liest den Tag und +# schreibt ihn vor jedem Bau in beide Dateien. Geschrieben wird IMMER die +# reine Form X.Y.Z, nie eine Vorab- oder Metadaten-Form (Pitfall 2: NSIS' +# VIProductVersion/VIFileVersion sind rein numerisch, das ist eine +# Windows-Ressourcen-Vorgabe, keine Tauri-Entscheidung). Die +# Beta-vs-Freigabe-Unterscheidung lebt ausschliesslich im Dateinamen-Suffix +# und in manifest.json (desktop-collect.sh), nicht hier. +# +# DESKTOP_TAG dient nur der lokalen Probe (siehe unten); im CI ist +# `fetch-depth: 0` Pflicht, sonst findet `git describe` keinen Tag. +# +# Option --print: nur die ermittelte Version ausgeben, nichts schreiben. +# +# Dieses Skript kennt kein Secret. +set -eu + +CONF="apps/desktop/src-tauri/tauri.conf.json" +CARGO="apps/desktop/src-tauri/Cargo.toml" + +PRINT_ONLY=0 +if [ "${1:-}" = "--print" ]; then + PRINT_ONLY=1 +fi + +if [ -n "${DESKTOP_TAG:-}" ]; then + TAG="$DESKTOP_TAG" +else + if ! TAG="$(git describe --tags --abbrev=0 --match 'v[0-9]*' 2>/dev/null)"; then + echo "Kein erreichbarer Freigabe-Tag (v*) -- im CI ist fetch-depth: 0 Pflicht." >&2 + exit 1 + fi +fi + +VERSION="${TAG#v}" +if ! printf '%s' "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then + echo "Tag '$TAG' ergibt keine reine X.Y.Z-Version ('$VERSION') -- Vorab-/Metadatenformen werden nie geschrieben (Pitfall 2)." >&2 + exit 1 +fi + +if [ "$PRINT_ONLY" = "1" ]; then + printf '%s\n' "$VERSION" + exit 0 +fi + +jq --arg v "$VERSION" '.version = $v' "$CONF" > "$CONF.tmp" && mv "$CONF.tmp" "$CONF" +sed -i "s/^version = \".*\"/version = \"$VERSION\"/" "$CARGO" + +echo "Desktop-Version gesetzt: $VERSION (aus Tag $TAG)" diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 1a96b96..0615e52 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -1,6 +1,6 @@ { "name": "@tessera/desktop", - "version": "0.0.1", + "version": "1.1.0", "private": true, "scripts": { "tauri": "tauri", diff --git a/apps/desktop/src-tauri/Cargo.lock b/apps/desktop/src-tauri/Cargo.lock index 71e9849..cda9ae3 100644 --- a/apps/desktop/src-tauri/Cargo.lock +++ b/apps/desktop/src-tauri/Cargo.lock @@ -3986,7 +3986,7 @@ dependencies = [ [[package]] name = "tessera-desktop" -version = "0.0.1" +version = "1.1.0" dependencies = [ "reqwest 0.12.28", "serde", diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml index 30d9b78..ef5f7ca 100644 --- a/apps/desktop/src-tauri/Cargo.toml +++ b/apps/desktop/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tessera-desktop" -version = "0.0.1" +version = "1.1.0" edition = "2021" [lib] diff --git a/apps/desktop/src-tauri/tauri.conf.json b/apps/desktop/src-tauri/tauri.conf.json index 9211c9b..d8ab32b 100644 --- a/apps/desktop/src-tauri/tauri.conf.json +++ b/apps/desktop/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://raw.githubusercontent.com/tauri-apps/tauri/dev/crates/tauri-config-schema/schema.json", "productName": "Tessera", - "version": "0.0.1", + "version": "1.1.0", "identifier": "de.ctl.tessera.desktop", "build": { "frontendDist": "../src", @@ -26,7 +26,13 @@ }, "bundle": { "active": true, - "targets": ["appimage", "nsis"], - "icon": ["icons/icon.png", "icons/icon.ico"] + "targets": [ + "appimage", + "nsis" + ], + "icon": [ + "icons/icon.png", + "icons/icon.ico" + ] } }