From 6aeea13033024739115b789dcdfd8b107eeb709e Mon Sep 17 00:00:00 2001 From: MathildeDec <149895843+MathildeDec@users.noreply.github.com> Date: Thu, 22 Oct 2026 18:51:15 +0000 Subject: [PATCH 1/2] ci: workflow de release standard (#92) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tag vX.Y.Z = version de pyproject.toml, commit tagué porté par main, notes tirées de CHANGELOG.md, archive des sources jointe à la release. Closes #92 --- .github/workflows/release.yml | 64 +++++++++++++++++++++++++++++++++++ CHANGELOG.md | 8 +++++ 2 files changed, 72 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 CHANGELOG.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e97dbe7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,64 @@ +# Publication d'une version (release.yml standard de la team) : pousser sur main un +# tag vX.Y.Z égal à la version de pyproject.toml, après avoir daté sa section +# « ## [X.Y.Z] - AAAA-MM-JJ » dans CHANGELOG.md. La release GitHub reprend cette +# section comme notes et joint l'archive des sources du commit tagué. +name: Release + +"on": + push: + tags: ["v*"] + +permissions: + contents: write + +jobs: + release: + name: Publication + runs-on: ${{ fromJSON(vars.RUNS_ON_LINUX || '{"group":"maison","labels":["self-hosted","linux"]}') }} + env: + TAG: ${{ github.ref_name }} + DEPOT: ${{ github.event.repository.name }} + steps: + - name: Checkout du dépôt + uses: actions/checkout@v7 + with: + fetch-depth: 0 + + # python3 du runner maison trop ancien pour tomllib (Python ≥ 3.11). + - name: Installation de uv + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 + + - name: Tag = version de pyproject.toml + run: | + version=$(uv run --no-project --python 3.12 python -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])') + if [ "v${version}" != "${TAG}" ]; then + echo "::error::tag ${TAG} différent de la version de pyproject.toml (${version})" + exit 1 + fi + echo "VERSION=${version}" >> "${GITHUB_ENV}" + + - name: Tag porté par main + run: | + git fetch --no-tags origin main + if ! git merge-base --is-ancestor "${GITHUB_SHA}" FETCH_HEAD; then + echo "::error::le commit tagué ${TAG} n'est pas sur main (passer par le relais dev → main)" + exit 1 + fi + + - name: Notes tirées du CHANGELOG + run: | + awk -v titre="## [${VERSION}]" 'index($0, titre) == 1 { dedans = 1; next } dedans && /^## / { exit } dedans' CHANGELOG.md > notes.md + if ! grep -q '[^[:space:]]' notes.md; then + echo "::error::section « ## [${VERSION}] » absente ou vide dans CHANGELOG.md" + exit 1 + fi + + - name: Archive des sources + run: git archive --format=tar.gz --prefix="${DEPOT}-${VERSION}/" -o "${DEPOT}-${VERSION}.tar.gz" "${GITHUB_SHA}" + + - name: Release GitHub + uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3 + with: + body_path: notes.md + files: ${{ github.event.repository.name }}-*.tar.gz + fail_on_unmatched_files: true diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..5c857ca --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,8 @@ +# Journal des versions + +Format : [Keep a Changelog](https://keepachangelog.com/fr/1.1.0/). Les numéros suivent [SemVer](https://semver.org/lang/fr/), et la version de `pyproject.toml` est égale au tag. + +## [Non publié] + +### Ajouté +- **Workflow de release** (#92) : `.github/workflows/release.yml` publie une release GitHub au push d'un tag `vX.Y.Z` sur `main` (tag = version de `pyproject.toml`, notes tirées de la section `## [X.Y.Z]` de ce journal, archive des sources jointe). From 43287f464253c2805b40d379c17b8b0534312cdd Mon Sep 17 00:00:00 2001 From: MathildeDec <149895843+MathildeDec@users.noreply.github.com> Date: Thu, 22 Oct 2026 19:42:23 +0000 Subject: [PATCH 2/2] chore(release): v1.0.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Section [Non publié] du CHANGELOG datée du 22/10/2026 : première release GitHub, à la version déjà déclarée dans pyproject.toml. --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c857ca..f46c57c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,9 @@ Format : [Keep a Changelog](https://keepachangelog.com/fr/1.1.0/). Les numéros suivent [SemVer](https://semver.org/lang/fr/), et la version de `pyproject.toml` est égale au tag. -## [Non publié] +## [1.0.0] - 2026-10-22 + +Première version publiée sous forme de release GitHub. ### Ajouté - **Workflow de release** (#92) : `.github/workflows/release.yml` publie une release GitHub au push d'un tag `vX.Y.Z` sur `main` (tag = version de `pyproject.toml`, notes tirées de la section `## [X.Y.Z]` de ce journal, archive des sources jointe).