@ferrflow/doc 7.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs-en/ci/github-actions.md +120 -0
- package/docs-en/ci/gitlab-ci.md +90 -0
- package/docs-en/ci/hosted-bot.md +82 -0
- package/docs-en/ci/pipeline-triggers.md +287 -0
- package/docs-en/configuration/config-file.md +1259 -0
- package/docs-en/configuration/formats.md +220 -0
- package/docs-en/configuration/monorepo.md +390 -0
- package/docs-en/installation.md +56 -0
- package/docs-en/introduction.md +56 -0
- package/docs-en/quickstart.md +66 -0
- package/docs-en/reference/api.md +106 -0
- package/docs-en/reference/cli.md +483 -0
- package/docs-en/reference/conventional-commits.md +103 -0
- package/docs-en/reference/errors.md +508 -0
- package/docs-en/verifying-releases.md +97 -0
- package/docs-fr/ci/github-actions.md +109 -0
- package/docs-fr/ci/gitlab-ci.md +77 -0
- package/docs-fr/ci/hosted-bot.md +82 -0
- package/docs-fr/ci/pipeline-triggers.md +238 -0
- package/docs-fr/configuration/config-file.md +839 -0
- package/docs-fr/configuration/formats.md +163 -0
- package/docs-fr/configuration/monorepo.md +357 -0
- package/docs-fr/installation.md +56 -0
- package/docs-fr/introduction.md +54 -0
- package/docs-fr/quickstart.md +63 -0
- package/docs-fr/reference/api.md +106 -0
- package/docs-fr/reference/cli.md +407 -0
- package/docs-fr/reference/conventional-commits.md +103 -0
- package/docs-fr/reference/errors.md +378 -0
- package/docs-fr/verifying-releases.md +97 -0
- package/docs-fr-v4/ci/github-actions.md +106 -0
- package/docs-fr-v4/ci/gitlab-ci.md +77 -0
- package/docs-fr-v4/ci/pipeline-triggers.md +214 -0
- package/docs-fr-v4/configuration/config-file.md +769 -0
- package/docs-fr-v4/configuration/formats.md +128 -0
- package/docs-fr-v4/configuration/monorepo.md +324 -0
- package/docs-fr-v4/installation.md +48 -0
- package/docs-fr-v4/introduction.md +54 -0
- package/docs-fr-v4/legal/telemetry.md +65 -0
- package/docs-fr-v4/quickstart.md +63 -0
- package/docs-fr-v4/reference/cli.md +130 -0
- package/docs-fr-v4/reference/conventional-commits.md +67 -0
- package/docs-fr-v4/reference/errors.md +372 -0
- package/docs-fr-v5/ci/github-actions.md +109 -0
- package/docs-fr-v5/ci/gitlab-ci.md +77 -0
- package/docs-fr-v5/ci/hosted-bot.md +82 -0
- package/docs-fr-v5/ci/pipeline-triggers.md +238 -0
- package/docs-fr-v5/configuration/config-file.md +812 -0
- package/docs-fr-v5/configuration/formats.md +150 -0
- package/docs-fr-v5/configuration/monorepo.md +357 -0
- package/docs-fr-v5/installation.md +56 -0
- package/docs-fr-v5/introduction.md +54 -0
- package/docs-fr-v5/legal/telemetry.md +26 -0
- package/docs-fr-v5/quickstart.md +63 -0
- package/docs-fr-v5/reference/api.md +106 -0
- package/docs-fr-v5/reference/cli.md +356 -0
- package/docs-fr-v5/reference/conventional-commits.md +88 -0
- package/docs-fr-v5/reference/errors.md +378 -0
- package/docs-fr-v5/verifying-releases.md +97 -0
- package/docs-fr-v6/ci/github-actions.md +109 -0
- package/docs-fr-v6/ci/gitlab-ci.md +77 -0
- package/docs-fr-v6/ci/hosted-bot.md +82 -0
- package/docs-fr-v6/ci/pipeline-triggers.md +238 -0
- package/docs-fr-v6/configuration/config-file.md +813 -0
- package/docs-fr-v6/configuration/formats.md +150 -0
- package/docs-fr-v6/configuration/monorepo.md +357 -0
- package/docs-fr-v6/installation.md +56 -0
- package/docs-fr-v6/introduction.md +54 -0
- package/docs-fr-v6/quickstart.md +63 -0
- package/docs-fr-v6/reference/api.md +106 -0
- package/docs-fr-v6/reference/cli.md +356 -0
- package/docs-fr-v6/reference/conventional-commits.md +88 -0
- package/docs-fr-v6/reference/errors.md +378 -0
- package/docs-fr-v6/verifying-releases.md +97 -0
- package/docs-v0/ci/github-actions.md +77 -0
- package/docs-v0/ci/gitlab-ci.md +59 -0
- package/docs-v0/configuration/config-file.md +97 -0
- package/docs-v0/configuration/formats.md +86 -0
- package/docs-v0/configuration/monorepo.md +59 -0
- package/docs-v0/installation.md +48 -0
- package/docs-v0/introduction.md +34 -0
- package/docs-v0/legal/telemetry.md +63 -0
- package/docs-v0/quickstart.md +58 -0
- package/docs-v0/reference/cli.md +95 -0
- package/docs-v0/reference/conventional-commits.md +68 -0
- package/docs-v1/ci/github-actions.md +76 -0
- package/docs-v1/ci/gitlab-ci.md +58 -0
- package/docs-v1/configuration/config-file.md +515 -0
- package/docs-v1/configuration/formats.md +115 -0
- package/docs-v1/configuration/monorepo.md +246 -0
- package/docs-v1/installation.md +48 -0
- package/docs-v1/introduction.md +39 -0
- package/docs-v1/legal/telemetry.md +63 -0
- package/docs-v1/quickstart.md +62 -0
- package/docs-v1/reference/cli.md +128 -0
- package/docs-v1/reference/conventional-commits.md +67 -0
- package/docs-v2/ci/github-actions.md +117 -0
- package/docs-v2/ci/gitlab-ci.md +90 -0
- package/docs-v2/ci/pipeline-triggers.md +263 -0
- package/docs-v2/configuration/config-file.md +806 -0
- package/docs-v2/configuration/formats.md +98 -0
- package/docs-v2/configuration/monorepo.md +324 -0
- package/docs-v2/installation.md +48 -0
- package/docs-v2/introduction.md +40 -0
- package/docs-v2/legal/telemetry.md +66 -0
- package/docs-v2/quickstart.md +63 -0
- package/docs-v2/reference/cli.md +130 -0
- package/docs-v2/reference/conventional-commits.md +67 -0
- package/docs-v2/reference/errors.md +500 -0
- package/docs-v2/self-hosting.md +101 -0
- package/docs-v3/ci/github-actions.md +117 -0
- package/docs-v3/ci/gitlab-ci.md +90 -0
- package/docs-v3/ci/pipeline-triggers.md +263 -0
- package/docs-v3/configuration/config-file.md +806 -0
- package/docs-v3/configuration/formats.md +99 -0
- package/docs-v3/configuration/monorepo.md +324 -0
- package/docs-v3/installation.md +48 -0
- package/docs-v3/introduction.md +40 -0
- package/docs-v3/legal/telemetry.md +66 -0
- package/docs-v3/quickstart.md +66 -0
- package/docs-v3/reference/cli.md +161 -0
- package/docs-v3/reference/conventional-commits.md +67 -0
- package/docs-v3/reference/errors.md +502 -0
- package/docs-v3/self-hosting.md +137 -0
- package/docs-v4/ci/github-actions.md +117 -0
- package/docs-v4/ci/gitlab-ci.md +90 -0
- package/docs-v4/ci/pipeline-triggers.md +263 -0
- package/docs-v4/configuration/config-file.md +850 -0
- package/docs-v4/configuration/formats.md +182 -0
- package/docs-v4/configuration/monorepo.md +324 -0
- package/docs-v4/installation.md +48 -0
- package/docs-v4/introduction.md +56 -0
- package/docs-v4/legal/telemetry.md +65 -0
- package/docs-v4/quickstart.md +66 -0
- package/docs-v4/reference/cli.md +161 -0
- package/docs-v4/reference/conventional-commits.md +67 -0
- package/docs-v4/reference/errors.md +502 -0
- package/docs-v4/self-hosting.md +137 -0
- package/docs-v5/ci/github-actions.md +120 -0
- package/docs-v5/ci/gitlab-ci.md +90 -0
- package/docs-v5/ci/hosted-bot.md +82 -0
- package/docs-v5/ci/pipeline-triggers.md +287 -0
- package/docs-v5/configuration/config-file.md +1133 -0
- package/docs-v5/configuration/formats.md +206 -0
- package/docs-v5/configuration/monorepo.md +390 -0
- package/docs-v5/installation.md +56 -0
- package/docs-v5/introduction.md +56 -0
- package/docs-v5/legal/telemetry.md +26 -0
- package/docs-v5/quickstart.md +66 -0
- package/docs-v5/reference/api.md +106 -0
- package/docs-v5/reference/cli.md +431 -0
- package/docs-v5/reference/conventional-commits.md +88 -0
- package/docs-v5/reference/errors.md +508 -0
- package/docs-v5/verifying-releases.md +97 -0
- package/docs-v6/ci/github-actions.md +120 -0
- package/docs-v6/ci/gitlab-ci.md +90 -0
- package/docs-v6/ci/hosted-bot.md +82 -0
- package/docs-v6/ci/pipeline-triggers.md +287 -0
- package/docs-v6/configuration/config-file.md +1134 -0
- package/docs-v6/configuration/formats.md +206 -0
- package/docs-v6/configuration/monorepo.md +390 -0
- package/docs-v6/installation.md +56 -0
- package/docs-v6/introduction.md +56 -0
- package/docs-v6/quickstart.md +66 -0
- package/docs-v6/reference/api.md +106 -0
- package/docs-v6/reference/cli.md +431 -0
- package/docs-v6/reference/conventional-commits.md +88 -0
- package/docs-v6/reference/errors.md +508 -0
- package/docs-v6/verifying-releases.md +97 -0
- package/package.json +17 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Bot hébergé (ferrflow[bot])
|
|
3
|
+
description: Publier des releases sous l'identité ferrflow[bot] sans aucun secret, grâce à la GitHub App hébergée de FerrFlow et à l'échange de token OIDC.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Par défaut, les releases et les tags que FerrFlow pousse sont attribués au propriétaire du token présent dans votre workflow — généralement un personal access token, si bien que les releases apparaissent sous _votre_ compte. Le bot hébergé permet à la place d'attribuer les releases à **`ferrflow[bot]`**, avec une identité propre et cohérente sur tous vos repos.
|
|
7
|
+
|
|
8
|
+
Le principe est celui de Renovate ou Dependabot :
|
|
9
|
+
|
|
10
|
+
- **Zéro secret** dans votre workflow — aucun PAT à créer, stocker ou faire tourner.
|
|
11
|
+
- Releases attribuées à **`ferrflow[bot]`**.
|
|
12
|
+
- **Tokens courts et scopés** — chaque run reçoit un token neuf qui expire au bout d'une heure et est limité à un seul repository.
|
|
13
|
+
|
|
14
|
+
## 1. Installer l'app
|
|
15
|
+
|
|
16
|
+
Rendez-vous sur **[github.com/apps/ferrflow](https://github.com/apps/ferrflow)**, cliquez sur **Install**, puis choisissez l'organisation et les repositories que FerrFlow doit pouvoir publier. C'est tout — aucun secret à créer.
|
|
17
|
+
|
|
18
|
+
L'app ne demande que **Contents** (lecture et écriture, pour pousser les tags et créer les releases) et **Metadata** (lecture). Vous pouvez la revoir ou la désinstaller à tout moment depuis les réglages de votre organisation.
|
|
19
|
+
|
|
20
|
+
## 2. L'activer dans votre workflow
|
|
21
|
+
|
|
22
|
+
Ajoutez `bot: true` à l'action et accordez au workflow la permission d'émettre un token OIDC :
|
|
23
|
+
|
|
24
|
+
```yaml title=".github/workflows/release.yml"
|
|
25
|
+
name: Release
|
|
26
|
+
|
|
27
|
+
on:
|
|
28
|
+
push:
|
|
29
|
+
branches: [main]
|
|
30
|
+
|
|
31
|
+
jobs:
|
|
32
|
+
release:
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
permissions:
|
|
35
|
+
id-token: write # permet au runner de prouver l'identité du repo à FerrFlow
|
|
36
|
+
contents: read # pour le checkout ; le push de la release utilise le token du bot
|
|
37
|
+
steps:
|
|
38
|
+
- uses: actions/checkout@v6
|
|
39
|
+
with:
|
|
40
|
+
fetch-depth: 0 # l'historique complet est nécessaire à l'analyse des commits
|
|
41
|
+
|
|
42
|
+
- uses: FerrLabs/FerrFlow@v5
|
|
43
|
+
with:
|
|
44
|
+
bot: true
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`permissions.id-token: write` est obligatoire — c'est ce qui permet au runner de demander le token OIDC prouvant quel repository appelle. Sans cette permission, FerrFlow s'arrête avec une erreur claire plutôt que de se rabattre silencieusement sur autre chose.
|
|
48
|
+
|
|
49
|
+
## Comment ça marche
|
|
50
|
+
|
|
51
|
+
Aucun secret ne quitte jamais votre repository. Chaque run échange une preuve d'identité contre un token :
|
|
52
|
+
|
|
53
|
+
1. Le runner GitHub Actions émet un **token OIDC** court décrivant votre repository (audience `ferrflow.ferrlabs.com`).
|
|
54
|
+
2. FerrFlow envoie ce token à **`api.ferrflow.com`**, qui le vérifie contre les clés publiques de GitHub.
|
|
55
|
+
3. Le service signe un **token d'installation scopé** pour l'app FerrFlow sur votre repo (avec une clé privée qui ne quitte jamais le KMS de FerrLabs) et le renvoie. Le token vit une heure.
|
|
56
|
+
4. FerrFlow utilise ce token pour pousser tags, commits et releases — attribués à `ferrflow[bot]`.
|
|
57
|
+
|
|
58
|
+
## Modèle de sécurité
|
|
59
|
+
|
|
60
|
+
- **La clé privée de l'app ne quitte jamais les serveurs de FerrLabs** — elle réside dans un KMS et ne sert qu'à signer des tokens d'installation côté serveur.
|
|
61
|
+
- **Votre identité est prouvée par OIDC, pas par un secret partagé** — rien de sensible n'est stocké dans votre repo ni transmis depuis celui-ci.
|
|
62
|
+
- **Les tokens sont minimaux et éphémères** — limités à un seul repository, expirant au bout d'une heure.
|
|
63
|
+
- **Vous gardez le contrôle** — désinstallez l'app à tout moment pour révoquer immédiatement tout accès.
|
|
64
|
+
|
|
65
|
+
## Dépannage
|
|
66
|
+
|
|
67
|
+
FerrFlow ne se rabat jamais en silence : si le mode bot ne peut pas obtenir de token, il échoue avec un message nommant la cause exacte.
|
|
68
|
+
|
|
69
|
+
| Message | Cause et correctif |
|
|
70
|
+
| ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
|
71
|
+
| `bot mode requires permissions: id-token: write in your workflow` | Le job n'a pas `permissions.id-token: write`. Ajoutez-le (voir ci-dessus). |
|
|
72
|
+
| `FerrFlow App not installed on this repository's owner` | Installez l'app sur [github.com/apps/ferrflow](https://github.com/apps/ferrflow) pour cette org / ce repo. |
|
|
73
|
+
| `FerrFlow hosted bot rate limit hit (429)` | Les demandes de token sont limitées par repository. Réessayez sous peu, ou utilisez un PAT via `token:` pour ce run. |
|
|
74
|
+
| `FerrFlow hosted bot service unavailable` | Incident temporaire du service. Consultez [status.ferrlabs.com](https://status.ferrlabs.com) ou réessayez. |
|
|
75
|
+
|
|
76
|
+
## Alternatives
|
|
77
|
+
|
|
78
|
+
Le bot hébergé est la voie recommandée, mais ce n'est pas la seule :
|
|
79
|
+
|
|
80
|
+
- **`token:` avec un PAT** — fournissez votre propre [personal access token](/fr/docs/ci/github-actions). Les releases sont attribuées au propriétaire de ce token. Fonctionne partout, y compris hors GitHub Actions.
|
|
81
|
+
- **`token:` avec votre propre GitHub App** — si vous préférez faire tourner votre propre identité de bot, passez un token émis par votre app.
|
|
82
|
+
- **`GITHUB_TOKEN` par défaut** — l'option la plus simple, mais notez que les push effectués avec `GITHUB_TOKEN` **ne déclenchent pas les workflows en aval** (un push de tag ne lancera donc pas un job de publish séparé). Le bot hébergé et les PAT n'ont pas cette limite.
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Triggers de pipeline
|
|
3
|
+
description: Choisir la bonne strategie de declenchement CI pour vos releases FerrFlow.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
FerrFlow fonctionne avec n'importe quelle strategie de declenchement CI. Cette page couvre les patterns les plus courants, quand les utiliser, et comment ils interagissent avec `releaseCommitMode`.
|
|
7
|
+
|
|
8
|
+
## Push sur main
|
|
9
|
+
|
|
10
|
+
La configuration la plus simple : executer `ferrflow release` a chaque push sur la branche par defaut. FerrFlow determine si une release est necessaire en se basant sur les commits depuis le dernier tag.
|
|
11
|
+
|
|
12
|
+
```yaml title=".github/workflows/release.yml"
|
|
13
|
+
name: Release
|
|
14
|
+
|
|
15
|
+
on:
|
|
16
|
+
push:
|
|
17
|
+
branches: [main]
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
release:
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
|
|
23
|
+
permissions:
|
|
24
|
+
contents: write
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@v6
|
|
27
|
+
with:
|
|
28
|
+
fetch-depth: 0
|
|
29
|
+
token: ${{ secrets.FERRFLOW_TOKEN }}
|
|
30
|
+
|
|
31
|
+
- uses: FerrLabs/ferrflow@v5
|
|
32
|
+
env:
|
|
33
|
+
GITHUB_TOKEN: ${{ secrets.FERRFLOW_TOKEN }}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Quand l'utiliser :** La plupart des projets. Simple, previsible, entierement automatise.
|
|
37
|
+
|
|
38
|
+
**Compromis :** Chaque push sur main declenche un workflow, meme si aucune release n'est necessaire. FerrFlow se termine rapidement quand il n'y a pas de commits a releaser.
|
|
39
|
+
|
|
40
|
+
**Compatible avec :** `releaseCommitMode: commit` (par defaut) ou `none`.
|
|
41
|
+
|
|
42
|
+
## Declenchement par tag
|
|
43
|
+
|
|
44
|
+
Executez votre pipeline de build/deploiement quand FerrFlow cree un nouveau tag. Cela separe l'etape de release (tagging) des etapes en aval (build, publication, deploiement).
|
|
45
|
+
|
|
46
|
+
```yaml title=".github/workflows/build.yml"
|
|
47
|
+
name: Build & Publish
|
|
48
|
+
|
|
49
|
+
on:
|
|
50
|
+
push:
|
|
51
|
+
tags:
|
|
52
|
+
- 'v*' # single-repo: v1.2.0
|
|
53
|
+
- '*@v*' # monorepo: api@v1.2.0, site@v0.5.1
|
|
54
|
+
|
|
55
|
+
jobs:
|
|
56
|
+
build:
|
|
57
|
+
runs-on: ubuntu-latest
|
|
58
|
+
steps:
|
|
59
|
+
- uses: actions/checkout@v6
|
|
60
|
+
|
|
61
|
+
- name: Extraire la version du tag
|
|
62
|
+
id: version
|
|
63
|
+
run: |
|
|
64
|
+
TAG="${GITHUB_REF_NAME}"
|
|
65
|
+
VERSION="${TAG##*v}"
|
|
66
|
+
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
|
|
67
|
+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
|
68
|
+
|
|
69
|
+
- name: Build
|
|
70
|
+
run: echo "Building version ${{ steps.version.outputs.version }}"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Quand l'utiliser :** Quand vous voulez decoupler le versioning du build/deploiement. Courant pour les builds Docker, la publication npm ou les releases binaires.
|
|
74
|
+
|
|
75
|
+
**Compromis :** Necessite deux workflows : un pour la release (push-to-main) et un pour le build en aval (tag-triggered). Ajoute quelques secondes de latence.
|
|
76
|
+
|
|
77
|
+
### Monorepo : builds par package
|
|
78
|
+
|
|
79
|
+
Dans un monorepo, utilisez les patterns de tags pour ne builder que le package concerne :
|
|
80
|
+
|
|
81
|
+
```yaml title=".github/workflows/build.yml"
|
|
82
|
+
name: Build Package
|
|
83
|
+
|
|
84
|
+
on:
|
|
85
|
+
push:
|
|
86
|
+
tags:
|
|
87
|
+
- 'api@v*'
|
|
88
|
+
- 'site@v*'
|
|
89
|
+
|
|
90
|
+
jobs:
|
|
91
|
+
build-api:
|
|
92
|
+
if: startsWith(github.ref_name, 'api@v')
|
|
93
|
+
runs-on: ubuntu-latest
|
|
94
|
+
steps:
|
|
95
|
+
- uses: actions/checkout@v6
|
|
96
|
+
- run: echo "Building API ${{ github.ref_name }}"
|
|
97
|
+
|
|
98
|
+
build-site:
|
|
99
|
+
if: startsWith(github.ref_name, 'site@v')
|
|
100
|
+
runs-on: ubuntu-latest
|
|
101
|
+
steps:
|
|
102
|
+
- uses: actions/checkout@v6
|
|
103
|
+
- run: echo "Building site ${{ github.ref_name }}"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
<aside class="ferr-aside ferr-aside--note"><div class="ferr-aside__body"><p>Si FerrFlow release plusieurs packages en une seule execution (ex: <code>api@v1.3.0</code> et <code>site@v0.5.1</code>), chaque tag declenche son propre workflow. Les builds s'executent en parallele automatiquement.</p>
|
|
107
|
+
</div></aside>
|
|
108
|
+
|
|
109
|
+
## Declenchement par release
|
|
110
|
+
|
|
111
|
+
Executez un pipeline quand une GitHub Release est publiee. Fonctionne bien avec le flag `--draft` de FerrFlow : FerrFlow cree une release brouillon, vous la reviewez, puis la publication declenche le build.
|
|
112
|
+
|
|
113
|
+
```yaml title=".github/workflows/deploy.yml"
|
|
114
|
+
name: Deploy
|
|
115
|
+
|
|
116
|
+
on:
|
|
117
|
+
release:
|
|
118
|
+
types: [published]
|
|
119
|
+
|
|
120
|
+
jobs:
|
|
121
|
+
deploy:
|
|
122
|
+
runs-on: ubuntu-latest
|
|
123
|
+
steps:
|
|
124
|
+
- uses: actions/checkout@v6
|
|
125
|
+
with:
|
|
126
|
+
ref: ${{ github.event.release.tag_name }}
|
|
127
|
+
|
|
128
|
+
- name: Deploy
|
|
129
|
+
run: echo "Deploying ${{ github.event.release.tag_name }}"
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**Quand l'utiliser :** Quand vous voulez une etape de revue manuelle avant le deploiement. Creez des releases brouillon avec `ferrflow release --draft`, reviewez le changelog, puis publiez.
|
|
133
|
+
|
|
134
|
+
**Compromis :** Ajoute une etape manuelle. La release brouillon doit etre publiee avant que le deploy ne se lance.
|
|
135
|
+
|
|
136
|
+
## Manuel (workflow_dispatch)
|
|
137
|
+
|
|
138
|
+
Declenchez une release a la demande avec un flag dry-run optionnel.
|
|
139
|
+
|
|
140
|
+
```yaml title=".github/workflows/release.yml"
|
|
141
|
+
name: Release
|
|
142
|
+
|
|
143
|
+
on:
|
|
144
|
+
workflow_dispatch:
|
|
145
|
+
inputs:
|
|
146
|
+
dry_run:
|
|
147
|
+
description: 'Dry run (pas de tags, pas de commits, pas de releases)'
|
|
148
|
+
type: boolean
|
|
149
|
+
default: false
|
|
150
|
+
|
|
151
|
+
jobs:
|
|
152
|
+
release:
|
|
153
|
+
runs-on: ubuntu-latest
|
|
154
|
+
permissions:
|
|
155
|
+
contents: write
|
|
156
|
+
steps:
|
|
157
|
+
- uses: actions/checkout@v6
|
|
158
|
+
with:
|
|
159
|
+
fetch-depth: 0
|
|
160
|
+
token: ${{ secrets.FERRFLOW_TOKEN }}
|
|
161
|
+
|
|
162
|
+
- uses: FerrLabs/ferrflow@v5
|
|
163
|
+
with:
|
|
164
|
+
args: ${{ inputs.dry_run == true && '--dry-run' || '' }}
|
|
165
|
+
env:
|
|
166
|
+
GITHUB_TOKEN: ${{ secrets.FERRFLOW_TOKEN }}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**Quand l'utiliser :** Equipes qui preferent des decisions de release explicites. Aussi utile comme workflow secondaire pour des releases ad-hoc.
|
|
170
|
+
|
|
171
|
+
## Base sur une PR
|
|
172
|
+
|
|
173
|
+
Utilisez `releaseCommitMode: pr` pour que FerrFlow ouvre une pull request avec le bump de version au lieu de committer directement.
|
|
174
|
+
|
|
175
|
+
```yaml title="ferrflow.json"
|
|
176
|
+
{ 'workspace': { 'releaseCommitMode': 'pr' } }
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
```yaml title=".github/workflows/release.yml"
|
|
180
|
+
name: Release
|
|
181
|
+
|
|
182
|
+
on:
|
|
183
|
+
push:
|
|
184
|
+
branches: [main]
|
|
185
|
+
|
|
186
|
+
jobs:
|
|
187
|
+
release:
|
|
188
|
+
runs-on: ubuntu-latest
|
|
189
|
+
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
|
|
190
|
+
permissions:
|
|
191
|
+
contents: write
|
|
192
|
+
pull-requests: write
|
|
193
|
+
steps:
|
|
194
|
+
- uses: actions/checkout@v6
|
|
195
|
+
with:
|
|
196
|
+
fetch-depth: 0
|
|
197
|
+
token: ${{ secrets.FERRFLOW_TOKEN }}
|
|
198
|
+
|
|
199
|
+
- uses: FerrLabs/ferrflow@v5
|
|
200
|
+
env:
|
|
201
|
+
GITHUB_TOKEN: ${{ secrets.FERRFLOW_TOKEN }}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
**Quand l'utiliser :** Quand vous voulez reviewer les bumps de version, ou quand la protection de branche empeche les push directs sur main.
|
|
205
|
+
|
|
206
|
+
## Securite de concurrence
|
|
207
|
+
|
|
208
|
+
Depuis la v5.2, `ferrflow release` acquiert `.git/ferrflow.lock` de maniere atomique (`O_CREAT|O_EXCL`) au debut de chaque execution mutante. Une seconde invocation concurrente sur le meme depot echoue immediatement avec une erreur claire au lieu de courir contre les refs git — le scenario classique est une release declenchee manuellement qui demarre en meme temps qu'un `auto-release` planifie en cron, ce qui produit des jeux de tags poussés à moitié, des refus non fast-forward ou des draft releases dupliquees.
|
|
209
|
+
|
|
210
|
+
Rien à brancher — le verrou est automatique sur chaque invocation `release`. Les commandes en lecture seule (`check`, `status`, `version`, `tag`) ne le prennent pas.
|
|
211
|
+
|
|
212
|
+
Si une execution précédente a planté sans relacher le verrou, l'invocation suivante le reprend automatiquement apres 30 minutes (l'hote + le PID inscrits dans le lockfile permettent à FerrFlow de detecter les verrous orphelins). Pour le reprendre plus tot, supprimez `.git/ferrflow.lock` à la main.
|
|
213
|
+
|
|
214
|
+
<aside class="ferr-aside ferr-aside--note"><div class="ferr-aside__body"><p>Le verrou est par-depot, scope a <code>.git/</code>. Il ne protege pas entre des clones separes du meme depot — si vous lancez des releases simultanees depuis deux runners differents contre deux checkouts du meme remote, le verrou ne voit pas l'autre cote. Utilisez un seul runner de release, ou serialisez au niveau CI (<code>concurrency:</code> dans GitHub Actions, <code>interruptible: false</code> dans GitLab).</p>
|
|
215
|
+
</div></aside>
|
|
216
|
+
|
|
217
|
+
## Reprise apres crash
|
|
218
|
+
|
|
219
|
+
Une release enchaine plusieurs etapes a effet de bord : ecriture des fichiers de version → commit → tag → push du commit → push des tags → creation des GitHub Releases → execution des hooks `post_publish`. Si le process meurt entre l'une d'elles (coupure reseau, arret du runner, SIGKILL), le depot reste dans un etat de release partiel.
|
|
220
|
+
|
|
221
|
+
Depuis la v5.3, FerrFlow ecrit `.git/ferrflow.checkpoint.json` apres chaque phase reussie. La prochaine invocation `ferrflow release` sur le meme commit reprend a la phase enregistree et saute le travail deja fait — utile a l'echelle CI ou les pannes transitoires sont la norme. Le checkpoint est efface automatiquement quand la release se termine sans erreur.
|
|
222
|
+
|
|
223
|
+
Deux garde-fous :
|
|
224
|
+
|
|
225
|
+
- Verrouillage HEAD : le checkpoint enregistre le SHA du commit sur lequel la release tournait. Si vous avancez HEAD entre deux runs, FerrFlow refuse de reprendre et vous demande soit de revenir au commit enregistre, soit de supprimer le checkpoint manuellement. Ca evite de rejouer d'anciens tags sur un graphe de commits different.
|
|
226
|
+
- Idempotence : les operations git et forge sous-jacentes sont deja idempotentes (pousser un tag deja pousse est un no-op, creer une release qui existe deja la reutilise), donc un crash en milieu de phase recupere proprement au run suivant.
|
|
227
|
+
|
|
228
|
+
Pour repartir de zero apres un crash dont vous ne voulez pas reprendre l'etat, supprimez `.git/ferrflow.checkpoint.json` a la main.
|
|
229
|
+
|
|
230
|
+
## Resume
|
|
231
|
+
|
|
232
|
+
| Trigger | Automatique | Gate de revue | Ideal pour |
|
|
233
|
+
| ----------------- | ----------- | ------------- | ----------------------------- |
|
|
234
|
+
| Push sur main | Oui | Non | La plupart des projets |
|
|
235
|
+
| Tag-triggered | Oui | Non | Build/deploy decouples |
|
|
236
|
+
| Release-triggered | Non | Oui | Brouillon, revue, publication |
|
|
237
|
+
| Manuel | Non | Oui | Cadence de release controlee |
|
|
238
|
+
| Base sur PR | Partiel | Oui | Protection de branche / revue |
|