Files
opu/tools/release.sh
T
yann64andClaude Opus 5.5 384aaf78c6 gtk: interface GTK4, préférences, versions, traductions, licence MIT
- interface gtkmm-4 : véhicules, ajout par VIN, mises à jour, dossier,
  téléchargement avec reprise et arrêt, choix de la clé, confirmation,
  écriture avec progression, fin avec guide d'installation ; travail
  dans un thread, résultats renvoyés via Glib::Dispatcher
- préférences : dossier de téléchargement, langue (système par défaut),
  recherche automatique de nouvelle version d'OpenPU
- recherche de nouvelle version (releases GitHub, format tags Gitea
  accepté) avec ouverture de la page dans le navigateur ;
  openpu-cli app-update
- versions : project(VERSION) + git describe régénéré à chaque build,
  openpu-cli --version, À propos, User-Agent, CHANGELOG, tools/release.sh
  (étiquette annotée, push vers tous les remotes, release GitHub)
- traductions gettext : textes anglais, fr.po complet (96 chaînes),
  extracteur de secours sans xgettext
- core : module job (téléchargement licence/fw/carte), liens des guides
  PDF, ordre des véhicules conservé (ordered_json)
- licence MIT (LICENSE, en-têtes SPDX) ; dépôt principal sur GitHub
- validé dans WSLg : parcours complet jusqu'à l'écriture d'une clé loop
  (FAT32 propre, fichiers téléchargés supprimés)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WDASLCiN764v685boRVYar
2026-11-28 19:54:04 +01:00

45 lines
2.3 KiB
Bash

#!/bin/sh
# SPDX-License-Identifier: MIT
# Cut a release: set project(VERSION) in CMakeLists.txt, date the "Unreleased" section of
# CHANGELOG.md, commit, create the annotated tag vX.Y.Z, push to every remote (GitHub origin and
# the Gitea mirror) and publish the GitHub release that the in-app update check reads.
#
# usage: tools/release.sh X.Y.Z [--no-push]
set -eu
VERSION=${1:-}
PUSH=1
[ "${2:-}" = "--no-push" ] && PUSH=0
echo "$VERSION" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$' || { echo "usage: $0 X.Y.Z [--no-push]" >&2; exit 2; }
cd "$(dirname "$0")/.."
[ -z "$(git status --porcelain)" ] || { echo "the working tree is not clean" >&2; exit 1; }
git rev-parse -q --verify "refs/tags/v$VERSION" >/dev/null && { echo "tag v$VERSION already exists" >&2; exit 1; }
grep -q '^## \[Unreleased\]' CHANGELOG.md || { echo "CHANGELOG.md has no [Unreleased] section" >&2; exit 1; }
PREVIOUS=$(git describe --tags --abbrev=0 --match 'v[0-9]*' 2>/dev/null || true)
TODAY=$(date +%Y-%m-%d)
sed -i "s/^project(openpu VERSION [0-9.]* /project(openpu VERSION $VERSION /" CMakeLists.txt
grep -q "^project(openpu VERSION $VERSION " CMakeLists.txt || { echo "cannot update CMakeLists.txt" >&2; exit 1; }
# New release section under an empty Unreleased one, and comparison links at the bottom.
sed -i "s/^## \[Unreleased\]$/## [Unreleased]\n\n## [$VERSION] - $TODAY/" CHANGELOG.md
sed -i "s|^\[Unreleased\]: \(.*\)/compare/v[0-9.]*\.\.\.HEAD$|[Unreleased]: \1/compare/v$VERSION...HEAD\n[$VERSION]: \1/releases/tag/v$VERSION|" CHANGELOG.md
git add CMakeLists.txt CHANGELOG.md
git commit -q -m "release: v$VERSION"
NOTES=$(awk -v v="$VERSION" '$0 ~ "^## \\[" v "\\]" {on=1; next} on && /^(## |\[)/ {exit} on {print}' CHANGELOG.md)
git tag -a "v$VERSION" -m "OpenPU $VERSION" -m "$NOTES"
echo "tagged v$VERSION (previous: ${PREVIOUS:-none})"
[ "$PUSH" = 1 ] || exit 0
for remote in $(git remote); do
git push --follow-tags "$remote" HEAD
done
GH=$(command -v gh || command -v gh.exe || true)
[ -z "$GH" ] && [ -x "/c/Program Files/GitHub CLI/gh.exe" ] && GH="/c/Program Files/GitHub CLI/gh.exe"
if [ -n "$GH" ]; then
printf '%s\n' "$NOTES" | "$GH" release create "v$VERSION" --verify-tag --title "OpenPU $VERSION" --notes-file -
else
echo "gh not found: create the GitHub release for v$VERSION by hand" >&2
fi