version support

This commit is contained in:
Agel committed 2026-11-18 22:16:15 +01:00
1 parent 62c08ac9e0
commit 0e6bfdc5ec
9 files changed
+381 -11

No files matched your search

+15 -1
View File
@@ -154,6 +154,16 @@ RUNNER_TOKEN="glrt-..." scripts/start-runner-macos.sh
scripts/start-runner-macos.sh
```
### Semantic Versioning & CI Release Pipeline
- **Base Version (`VERSION`)**: Tracked in the repository root as `MAJOR.MINOR.PATCH` (initially `0.1.0`). Bump manually when advancing `MAJOR` or `MINOR`.
- **Version Resolution (`scripts/compute-version.sh`)**:
- **On `master`**: Reuses an existing `vX.Y.Z` tag if `HEAD` is already tagged; otherwise sets `PATCH = max(BASE_PATCH, max_tag_patch + 1)` and outputs `MAJOR.MINOR.PATCH`.
- **On feature branches**: Computes `PATCH = max(BASE_PATCH, max_tag_patch + 1)` and outputs a SemVer 2.0.0 pre-release string `MAJOR.MINOR.PATCH-<sanitized-branch>.<short-sha>` (e.g., `0.1.2-fix-epub.62c08ac`).
- **Build & Metadata Propagation**: `CMakeLists.txt` resolves `ASTERIA_VERSION` (or accepts `-DASTERIA_VERSION=...`), populates `PROJECT_VERSION`, `ASTERIA_VERSION_STRING`, `QApplication::applicationVersion()`, `AppInfo.version`, macOS bundle `Info.plist` (`CFBundleShortVersionString` / `CFBundleVersion`), and Windows `VS_VERSION_INFO` via `src/asteria.rc.in`.
- **CI Isolation & Auto-Tagging (`.gitlab-ci.yml`)**:
- `update-wiki` and `bump-version` run strictly on `master` (non-MR pipelines). Feature branches never update the wiki or create tags.
- At the end of a successful `master` pipeline (`release` stage, after packaging and `update-wiki`), `bump-version` creates tag `vX.Y.Z` via the GitLab Tags API (using `GITLAB_TOKEN`). Tag pipelines (`$CI_COMMIT_TAG`) are skipped in `workflow: rules:` to prevent loops.
### VS Code & CMake Presets
Pre-configured tasks, launch configurations, and CMake presets are available:
- **CMake Presets**: `cmake --preset <debug|release>`, `cmake --build --preset <debug|release>`, `ctest --preset <debug|release>`.
@@ -180,7 +190,7 @@ Backend (C++) handles all file I/O, format parsing, text layout calculation, and
| `ReadingPreferences` (`ReadingPreferences`) | Font size, line spacing, horizontal margin, vertical margin (`QSettings`). |
| `UiState` (`UiState`) | Current theme, last page, sidebar open state, reader bars visibility (`barsVisible`), last file path, custom theme colors, window geometry. |
| `HistoryModel` (`HistoryModel`) | `QAbstractListModel` of recent books with async metadata extraction and reading progress. Entries store strongly-typed `QDateTime lastOpened`, immediately drop bogus/unparseable dates on deserialization, and are maintained strictly in descending chronological order (`lastOpened desc`). |
| `AppInfo` | Exposes compile-time build configuration (e.g. `AppInfo.isDebugBuild`). |
| `AppInfo` | Exposes compile-time build configuration (`AppInfo.isDebugBuild`, `AppInfo.version`). |
Backend singletons are exposed using `QML_FOREIGN` wrapper structs in `src/backend/QmlRegistrations.h`. This decouples backend classes from Qt QML engine headers in headless unit test suites while enabling static type checking, Ahead-Of-Time compilation via `qmlcachegen`, and zero-warning `qmllint` passes.
@@ -296,7 +306,11 @@ Asteria supports **Dark**, **Light**, and user-editable **Custom** themes:
## File Structure
```
VERSION
scripts/
compute-version.sh
src/
asteria.rc.in
main.cpp
backend/
AppCoordinator.h/cpp