Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}

Expand Down
16 changes: 11 additions & 5 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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]`.

Expand All @@ -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 <token>`) + `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ó.