chore(release): sync version desktop + workflow desktop en manuel (#77)
- bump_version.sh : met a jour tauri.conf.json, Cargo.toml et Cargo.lock (obsigate-desktop), commit de release chore(release): vX.Y.Z puis tag. --push pousse branche+tag, --no-files = tag seul, --dry-run previsualise. - desktop-build.yml : declenchement workflow_dispatch uniquement (aucun runner self-hosted). - Docs : DEVELOPMENT_AND_RELEASES (bump automatise) + CHANGELOG.
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
name: Desktop Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- 'desktop/**'
|
||||
- 'frontend/**'
|
||||
- 'backend/**'
|
||||
workflow_dispatch: # permet de lancer manuellement
|
||||
# Lancement manuel uniquement : aucun runner self-hosted [windows/linux, desktop]
|
||||
# n'est enregistré dans Gitea. Le build Windows se fait en local
|
||||
# (desktop/build-windows.bat). Ce workflow reste disponible pour un futur runner.
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-windows:
|
||||
|
||||
@@ -175,6 +175,18 @@ et [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
### Modifié
|
||||
|
||||
- **`scripts/bump_version.sh` — synchronisation de la version desktop** — le script met
|
||||
désormais à jour `desktop/tauri.conf.json`, `desktop/Cargo.toml` et `desktop/Cargo.lock`
|
||||
(`obsigate-desktop`) avant de créer un commit de release `chore(release): vX.Y.Z` puis le
|
||||
tag. `--push` pousse la branche **et** le tag ; `--no-files` conserve l'ancien comportement
|
||||
(tag seul) et `--dry-run` prévisualise. Indispensable au bon fonctionnement de l'updater
|
||||
Tauri (dont le manifeste reprend la version de `tauri.conf.json`).
|
||||
|
||||
- **`.gitea/workflows/desktop-build.yml` — déclenchement manuel uniquement** — le workflow
|
||||
`Desktop Build` ne s'exécute plus sur `push` (aucun runner self-hosted `[windows/linux, desktop]`
|
||||
enregistré) mais uniquement via `workflow_dispatch`. Le build Windows se fait en local
|
||||
(`desktop/build-windows.bat`) ; le workflow reste disponible pour un futur runner.
|
||||
|
||||
- **Assistant IA (`frontend/js/bookslm.js`)** — l'ancien rendu Markdown minimal est remplacé par un
|
||||
renderer bloc/inline complet ; l'en-tête expose un bouton « Historique des sessions » ; les badges
|
||||
de sources ouvrent désormais réellement le fichier (événement `obsigate:open-file`).
|
||||
|
||||
@@ -182,6 +182,23 @@ Une fois les modifications testées et validées :
|
||||
git push origin v2.0.0
|
||||
```
|
||||
|
||||
### Bump automatisé (recommandé)
|
||||
|
||||
`scripts/bump_version.sh` calcule la prochaine version depuis les commits
|
||||
(Conventional Commits), **synchronise la version desktop**
|
||||
(`tauri.conf.json`, `Cargo.toml`, `Cargo.lock`), crée un commit de release puis
|
||||
le tag :
|
||||
|
||||
```bash
|
||||
scripts/bump_version.sh --dry-run # prévisualiser la prochaine version
|
||||
scripts/bump_version.sh # bump + commit + tag (local)
|
||||
scripts/bump_version.sh --push # idem + push branche & tag
|
||||
```
|
||||
|
||||
> La version desktop doit être synchronisée avec le tag pour que l'updater Tauri
|
||||
> détecte les mises à jour (`latest.json` reprend la version de
|
||||
> `tauri.conf.json`). `--no-files` conserve l'ancien comportement (tag seul).
|
||||
|
||||
---
|
||||
|
||||
## 4. Publication des Binaires sur Gitea Releases
|
||||
|
||||
+67
-10
@@ -4,22 +4,27 @@
|
||||
#
|
||||
# The canonical version is the latest release tag. This tool inspects the
|
||||
# commits since that tag and decides the next version from their type
|
||||
# (Conventional Commits), then creates and pushes the new tag:
|
||||
# (Conventional Commits), then:
|
||||
# 1. synchronise la version desktop (tauri.conf.json, Cargo.toml, Cargo.lock) ;
|
||||
# 2. commit ce bump (`chore(release): vX.Y.Z`) ;
|
||||
# 3. crée le tag annoté (et pousse branche + tag avec --push).
|
||||
#
|
||||
# breaking change / `!:` / "BREAKING CHANGE" -> MAJOR bump (x.0.0)
|
||||
# feat / feature -> MINOR bump (x.y.0)
|
||||
# anything else (fix, perf, refactor, ...) -> PATCH bump (x.y.z)
|
||||
#
|
||||
# Usage:
|
||||
# scripts/bump_version.sh [--major|--minor|--patch] [--dry-run] [--push]
|
||||
# scripts/bump_version.sh [--major|--minor|--patch] [--dry-run] [--push] [--no-files]
|
||||
#
|
||||
# --dry-run : only print the computed next version, do not tag.
|
||||
# --push : also `git push origin` the new tag (default: local only).
|
||||
# --major|--minor|--patch : force the increment, overriding commit detection.
|
||||
# --dry-run : affiche la prochaine version sans rien modifier ni tagger.
|
||||
# --push : pousse la branche courante ET le nouveau tag vers origin.
|
||||
# --no-files : ne met pas à jour les fichiers desktop (tag seul).
|
||||
# --major|--minor|--patch : force l'incrément, ignore la détection.
|
||||
#
|
||||
# Examples:
|
||||
# scripts/bump_version.sh --dry-run # preview next version
|
||||
# scripts/bump_version.sh # tag locally per commits
|
||||
# scripts/bump_version.sh # bump + commit + tag (local)
|
||||
# scripts/bump_version.sh --push # idem + push branche & tag
|
||||
# scripts/bump_version.sh --patch --push # force patch + push
|
||||
# -----------------------------------------------------------------------------
|
||||
set -euo pipefail
|
||||
@@ -28,7 +33,7 @@ cd "$(git rev-parse --show-toplevel)" # run from repo root regardless of cwd
|
||||
BRANCH="$(git branch --show-current)"
|
||||
|
||||
# ── Parse args ────────────────────────────────────────────────────────────
|
||||
FORCE=""; DRY_RUN=0; DO_PUSH=0
|
||||
FORCE=""; DRY_RUN=0; DO_PUSH=0; DO_FILES=1
|
||||
for a in "$@"; do
|
||||
case "$a" in
|
||||
--major) FORCE=major ;;
|
||||
@@ -36,6 +41,7 @@ for a in "$@"; do
|
||||
--patch) FORCE=patch ;;
|
||||
--dry-run) DRY_RUN=1 ;;
|
||||
--push) DO_PUSH=1 ;;
|
||||
--no-files) DO_FILES=0 ;;
|
||||
*) echo "✗ Argument inconnu: $a"; exit 2 ;;
|
||||
esac
|
||||
done
|
||||
@@ -87,22 +93,73 @@ if git rev-parse "v${NEXT}" >/dev/null 2>&1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ── Fichiers desktop à synchroniser ───────────────────────────────────────
|
||||
DESKTOP_CONF="desktop/tauri.conf.json"
|
||||
DESKTOP_CARGO="desktop/Cargo.toml"
|
||||
DESKTOP_LOCK="desktop/Cargo.lock"
|
||||
|
||||
# Met à jour la version dans les fichiers desktop (in-place, portable GNU sed).
|
||||
sync_desktop_version() {
|
||||
local ver="$1"
|
||||
if [ -f "$DESKTOP_CONF" ]; then
|
||||
sed -i -E 's/^([[:space:]]*"version"[[:space:]]*:[[:space:]]*")[^"]*(")/\1'"$ver"'\2/' "$DESKTOP_CONF"
|
||||
fi
|
||||
if [ -f "$DESKTOP_CARGO" ]; then
|
||||
# Première ligne `version = "..."` = version du [package].
|
||||
sed -i -E '0,/^version = "[^"]*"/s//version = "'"$ver"'"/' "$DESKTOP_CARGO"
|
||||
fi
|
||||
if [ -f "$DESKTOP_LOCK" ]; then
|
||||
# Bloc `name = "obsigate-desktop"` -> ligne `version` suivante.
|
||||
sed -i -E '/^name = "obsigate-desktop"$/{n;s/^version = "[^"]*"/version = "'"$ver"'"/;}' "$DESKTOP_LOCK"
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$DRY_RUN" = "1" ]; then
|
||||
echo "── DRY RUN ─────────────────────────────"
|
||||
echo " Prochain tag : v${NEXT}"
|
||||
echo " (aucun tag créé)"
|
||||
if [ "$DO_FILES" = "1" ]; then
|
||||
echo " Fichiers desktop à synchroniser :"
|
||||
echo " - $DESKTOP_CONF"
|
||||
echo " - $DESKTOP_CARGO"
|
||||
echo " - $DESKTOP_LOCK (obsigate-desktop)"
|
||||
fi
|
||||
echo " (aucune modification, aucun tag créé)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# ── Sync + commit des versions desktop ────────────────────────────────────
|
||||
if [ "$DO_FILES" = "1" ]; then
|
||||
echo "─ Synchronisation de la version desktop → ${NEXT}"
|
||||
sync_desktop_version "$NEXT"
|
||||
|
||||
CHANGED_FILES=()
|
||||
for f in "$DESKTOP_CONF" "$DESKTOP_CARGO" "$DESKTOP_LOCK"; do
|
||||
[ -f "$f" ] && CHANGED_FILES+=("$f")
|
||||
done
|
||||
|
||||
if git diff --quiet -- "${CHANGED_FILES[@]}"; then
|
||||
echo "ℹ Aucun changement de version desktop à committer."
|
||||
else
|
||||
git add -- "${CHANGED_FILES[@]}"
|
||||
git commit -m "chore(release): v${NEXT}" \
|
||||
-m "Synchronise la version desktop (tauri.conf.json, Cargo.toml, Cargo.lock)."
|
||||
echo "✓ Commit de release créé : v${NEXT}"
|
||||
fi
|
||||
else
|
||||
echo "ℹ --no-files : fichiers desktop inchangés."
|
||||
fi
|
||||
|
||||
# ── Create tag ────────────────────────────────────────────────────────────
|
||||
git tag -a "v${NEXT}" -m "Release v${NEXT} (${BUMP} bump depuis v${CURRENT})"
|
||||
echo "✓ Tag créé localement : v${NEXT}"
|
||||
|
||||
if [ "$DO_PUSH" = "1" ]; then
|
||||
git push origin "$BRANCH"
|
||||
git push origin "v${NEXT}"
|
||||
echo "✓ Tag poussé : v${NEXT}"
|
||||
echo "✓ Branche '$BRANCH' et tag v${NEXT} poussés."
|
||||
else
|
||||
echo "ℹ Tag local uniquement. Poussez avec: git push origin v${NEXT}"
|
||||
echo "ℹ Tag local uniquement. Poussez avec:"
|
||||
echo " git push origin $BRANCH && git push origin v${NEXT}"
|
||||
fi
|
||||
|
||||
echo "Done."
|
||||
|
||||
Reference in New Issue
Block a user