Documente la chaine feature -> develop -> release -> tag et la regle 'tout commit lie a un ticket'. closes #1
52 lines
1.7 KiB
Markdown
52 lines
1.7 KiB
Markdown
# Démo — GitFlow + commitizen + tickets
|
|
|
|
Chaîne complète : **chaque commit est lié à un ticket**, les versions et le
|
|
CHANGELOG sont générés **automatiquement** (jamais à la main).
|
|
|
|
## Règle d'or
|
|
> Aucun commit sans ticket. Chaque message de commit référence une issue de la
|
|
> forge avec un mot-clé : `closes #N`, `fixes #N` ou `resolves #N`.
|
|
|
|
## 1. Créer le ticket (Forgejo)
|
|
Ouvrir une issue dans la forge → on obtient un numéro, ex. `#12`.
|
|
|
|
## 2. Développer sur une feature, commit lié au ticket
|
|
```bash
|
|
git switch develop
|
|
git switch -c feature/ma-tache
|
|
cz commit # commit conventionnel guidé
|
|
# Exemple de message (cf. `cz example`) :
|
|
# fix: correct minor typos in code
|
|
#
|
|
# see the issue for details on the typos fixed
|
|
#
|
|
# closes #12 <-- lien obligatoire vers le ticket
|
|
```
|
|
|
|
## 3. Intégrer dans develop
|
|
```bash
|
|
git switch develop
|
|
git merge --no-ff feature/ma-tache
|
|
```
|
|
|
|
## 4. Générer le CHANGELOG (automatique)
|
|
```bash
|
|
cz changelog # (re)génère CHANGELOG.md à partir des commits
|
|
```
|
|
|
|
## 5. Créer la release et le tag (automatique)
|
|
```bash
|
|
git switch -c release/x.y.z develop
|
|
cz bump # déduit la version (SemVer), MAJ cz.toml + CHANGELOG.md, crée le tag vX.Y.Z
|
|
git switch main && git merge --no-ff release/x.y.z
|
|
git switch develop && git merge --no-ff release/x.y.z
|
|
git push forge main develop --follow-tags
|
|
```
|
|
|
|
## Correspondance commit → version (SemVer)
|
|
| Commit | Effet sur la version |
|
|
|---------------------|---------------------------|
|
|
| `fix:` | correctif (0.0.**+1**) |
|
|
| `feat:` | mineur (0.**+1**.0) |
|
|
| `feat!:` / BREAKING | majeur (**+1**.0.0) |
|
|
| `docs:` `chore:` … | aucun bump |
|