feat: auto-increment version on deploy, show version in toolbar

This commit is contained in:
2026-05-24 03:14:39 +00:00
parent 508328b282
commit dcdbedc26e
3 changed files with 32 additions and 3 deletions
+1
View File
@@ -0,0 +1 @@
0.2.1
+16 -2
View File
@@ -17,6 +17,10 @@ from PyQt5.QtWidgets import (
_HOME = pathlib.Path.home() _HOME = pathlib.Path.home()
HOME_URL = f"file://{_HOME}/kiosk-home/index.html" HOME_URL = f"file://{_HOME}/kiosk-home/index.html"
BOOKMARKS_FILE = str(_HOME / "kiosk-browser/bookmarks.json") BOOKMARKS_FILE = str(_HOME / "kiosk-browser/bookmarks.json")
try:
_VERSION = (pathlib.Path(__file__).parent / "VERSION").read_text().strip()
except Exception:
_VERSION = "?"
CDP_PORT = 9222 CDP_PORT = 9222
TOOLBAR_H = 72 # single row — was 142 (82 + 60) TOOLBAR_H = 72 # single row — was 142 (82 + 60)
# Screen size is detected dynamically in main() after QApplication starts # Screen size is detected dynamically in main() after QApplication starts
@@ -670,11 +674,21 @@ class KioskOverlay(QWidget):
tl = QHBoxLayout(bar) tl = QHBoxLayout(bar)
tl.setContentsMargins(24, 7, 16, 7); tl.setSpacing(10) tl.setContentsMargins(24, 7, 16, 7); tl.setSpacing(10)
# Brand label # Brand label + version
brand_wrap = QWidget()
brand_wrap.setStyleSheet("background:transparent;")
brand_vbox = QVBoxLayout(brand_wrap)
brand_vbox.setContentsMargins(0, 0, 0, 0)
brand_vbox.setSpacing(0)
brand = QLabel("SeniorNet") brand = QLabel("SeniorNet")
brand.setFont(QFont("Arial", 22, QFont.Bold)) brand.setFont(QFont("Arial", 22, QFont.Bold))
brand.setStyleSheet("color:white;") brand.setStyleSheet("color:white;")
tl.addWidget(brand) ver = QLabel(f"v{_VERSION}")
ver.setFont(QFont("Arial", 10))
ver.setStyleSheet("color:#7aafd4;")
brand_vbox.addWidget(brand)
brand_vbox.addWidget(ver)
tl.addWidget(brand_wrap)
tl.addStretch() tl.addStretch()
# ◀ Back # ◀ Back
+15 -1
View File
@@ -10,7 +10,21 @@ REPO_DIR="$(cd "$(dirname "$0")" && pwd)"
HOME_SRC="$REPO_DIR/home-screen-index.html" HOME_SRC="$REPO_DIR/home-screen-index.html"
HOME_DST="/home/jgitta/kiosk-home/index.html" HOME_DST="/home/jgitta/kiosk-home/index.html"
CONFIG_SRC="$REPO_DIR/config.json" CONFIG_SRC="$REPO_DIR/config.json"
COMMIT_MSG="${1:-deploy: update from kiosk-dev $(date +%Y-%m-%d)}" # Auto-increment patch version (0.2.0 → 0.2.1 → 0.2.2 ...)
VERSION_FILE="$REPO_DIR/VERSION"
if [ -f "$VERSION_FILE" ]; then
CUR=$(cat "$VERSION_FILE" | tr -d '[:space:]')
MAJOR=$(echo "$CUR" | cut -d. -f1)
MINOR=$(echo "$CUR" | cut -d. -f2)
PATCH=$(echo "$CUR" | cut -d. -f3)
NEW_VERSION="$MAJOR.$MINOR.$((PATCH + 1))"
echo "$NEW_VERSION" > "$VERSION_FILE"
echo "==> Version: $CUR$NEW_VERSION"
else
NEW_VERSION="unknown"
fi
COMMIT_MSG="${1:-deploy: v$NEW_VERSION $(date +%Y-%m-%d)}"
# Gitea credentials (from credentials.md) # Gitea credentials (from credentials.md)
GITEA_TOKEN="4fe93c6c62490ef0bb4e4aeec58f47da26752ce8" GITEA_TOKEN="4fe93c6c62490ef0bb4e4aeec58f47da26752ce8"