From e79b079efa7dad25cc21e006ca4ba2b9697bee15 Mon Sep 17 00:00:00 2001 From: Pedro Bahamondes Date: Fri, 6 Nov 2026 23:53:39 -0300 Subject: [PATCH 1/3] ci(release): push the version commit and tag before publishing --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9e4df8b..9bab0a7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -110,6 +110,7 @@ jobs: bump: ${{ needs.resolve.outputs.bump }} version-format: py tag-prefix: v + push: 'true' app-id: ${{ vars.FIN_RELEASES_APP_ID }} app-private-key: ${{ secrets.FIN_RELEASES_PRIVATE_KEY }} From 2018ceaa9ec3c635dd928b9d2675fb0e4fcd0573 Mon Sep 17 00:00:00 2001 From: Pedro Bahamondes Date: Fri, 6 Nov 2026 23:53:39 -0300 Subject: [PATCH 2/3] docs(release): document the push-before-publish order and failure modes --- RELEASING.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/RELEASING.md b/RELEASING.md index 9770ec8..8eed850 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -17,10 +17,12 @@ https://github.com/fintoc-com/fintoc-python/actions → **release** → **Run wo ## Qué hace `make get-poetry` + `poetry install` → -[`release/prepare`](https://github.com/fintoc-com/release-action/tree/main/prepare) bumpea local → +[`release/prepare`](https://github.com/fintoc-com/release-action/tree/main/prepare) bumpea y pushea commit + tag a `master` de forma atómica → `poetry build` → `pypa/gh-action-pypi-publish` (con `PYPI_API_TOKEN`) → -[`release/finalize`](https://github.com/fintoc-com/release-action/tree/main/finalize) pushea commit + tag, crea GitHub Release. +[`release/finalize`](https://github.com/fintoc-com/release-action/tree/main/finalize) crea GitHub Release. + +El push va antes de publicar: si `master` se movió durante el release, el push se rechaza y no se publica nada. Todo autoreado por `fin-releases[bot]`. @@ -29,5 +31,9 @@ Todo autoreado por `fin-releases[bot]`. | Falla en | Estado | Recovery | |---|---|---| | `master` tiene commits posteriores al PR | Nada publicado | Esperar el siguiente release, o correr el manual | -| Antes o durante `pypi-publish` | Nada en el remote | Re-run | -| `release/finalize` (post-publish) | Paquete en PyPI, sin tag/release | PR con el commit del bump + `gh release create vX.Y.Z` | +| Antes del push (install, bump, token de la App) | Nada en el remote | Re-run | +| Push en `release/prepare` (`master` se movió) | Nada publicado: sin commit ni tag | Esperar el siguiente release, o correr el manual | +| Después del push, antes o durante `pypi-publish` | Commit y tag en `master`, versión no está en PyPI | Publicar desde el tag con un token de PyPI del proyecto (`git checkout vX.Y.Z && poetry build && poetry publish -u __token__ -p `) + `gh release create vX.Y.Z`. O saltarse la versión: el siguiente release bumpea desde ella | +| `release/finalize` (post-publish) | Paquete en PyPI, commit y tag, sin GitHub Release | `gh release create vX.Y.Z --notes '...'` | + +Re-correr el job después de que el push entró publica la versión siguiente, no la que falló. From ec47c6244b9f1a06a6cb50a5bbe549f646369f5b Mon Sep 17 00:00:00 2001 From: Pedro Bahamondes Date: Fri, 6 Nov 2026 23:58:16 -0300 Subject: [PATCH 3/3] ci(release): require fin-releases[bot] as author of release commits in the later-commits guard --- .github/workflows/release.yml | 2 +- RELEASING.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9bab0a7..5d8830a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -77,7 +77,7 @@ jobs: run: | head=$(git rev-parse HEAD) later=$(gh api "repos/$GITHUB_REPOSITORY/compare/$GITHUB_SHA...$head" \ - --jq '[.commits[] | select(.commit.message | startswith("release: ") | not) | .sha[0:7]] | join(" ")') + --jq '[.commits[] | select(.author.login != "fin-releases[bot]" or (.commit.message | startswith("release: ") | not)) | .sha[0:7]] | join(" ")') if [ -n "$later" ]; then echo "::error::master has commits merged after $GITHUB_SHA ($later). Aborting so they are not published with this PR's bump and notes. The next release will include this PR; use workflow_dispatch if it needs a bigger bump." exit 1 diff --git a/RELEASING.md b/RELEASING.md index 8eed850..a82fd55 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -8,7 +8,7 @@ Automático al mergear a `master`. Toma ~2–3 min. 2. Escribe en la sección `## Release notes` de la descripción del PR lo que verán los usuarios del SDK, en inglés. Si queda vacía, se usan las notas autogeneradas de GitHub. 3. Mergea. Los PRs sin label `release:*` no publican; un PR con más de uno hace fallar el workflow. -El release parte de `master` actualizado (incluye el commit de versión de un release anterior en cola). Si después del PR se mergeó algo más que un commit `release: ...`, aborta antes de publicar para no sacar esos cambios con el bump y las notas de este PR. El siguiente release los incluye; usa el manual si hace falta un bump mayor. +El release parte de `master` actualizado (incluye el commit de versión de un release anterior en cola). Si después del PR se mergeó algo más que un commit `release: ...` de `fin-releases[bot]`, aborta antes de publicar para no sacar esos cambios con el bump y las notas de este PR. El siguiente release los incluye; usa el manual si hace falta un bump mayor. ### Manual