From 2da8bd655816463e4c4b8100928a389d29e3159c Mon Sep 17 00:00:00 2001 From: Manuel Cillero Date: Sun, 3 May 2026 09:40:14 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Mejora=20herramientas=20de=20lib?= =?UTF-8?q?eraci=C3=B3n=20de=20versiones?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .cargo/cliff.toml | 12 +++++++++++- .gitignore | 1 - tools/changelog.sh | 24 +++++++++++++++--------- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/.cargo/cliff.toml b/.cargo/cliff.toml index cbbb57b6..f6f14106 100644 --- a/.cargo/cliff.toml +++ b/.cargo/cliff.toml @@ -40,9 +40,18 @@ body = """ | replace(from="🍱 ", to="") | replace(from="📝 ", to="") | replace(from="💡 ", to="") + | replace(from="🎨 ", to="") + | replace(from="✅ ", to="") + | replace(from="🔨 ", to="") + | replace(from="💄 ", to="") + | replace(from="🔥 ", to="") + | replace(from="🚩 ", to="") + | replace(from="🚨 ", to="") + | replace(from="📄 ", to="") + | replace(from="🩹 ", to="") -%} -- {{ msg | trim }} {% if commit.author.name != "Manuel Cillero" %} - {{ commit.author.name }}{% endif %} +- {{ msg | trim }}{% if commit.author.name != "Manuel Cillero" %} - {{ commit.author.name }}{% endif %} {% endfor %}{% endfor %} """ @@ -53,6 +62,7 @@ topo_order_commits = true sort_commits = "oldest" commit_parsers = [ + { message = "^🔖", skip = true }, { message = "^✨", group = "Añadido" }, { message = "^🐛", group = "Corregido" }, { message = "^🚑", group = "Corregido" }, diff --git a/.gitignore b/.gitignore index ab19156b..ed088133 100644 --- a/.gitignore +++ b/.gitignore @@ -8,5 +8,4 @@ **/local.*.toml **/local.toml .env -.cargo .vscode diff --git a/tools/changelog.sh b/tools/changelog.sh index 035fa729..cb30b2d7 100755 --- a/tools/changelog.sh +++ b/tools/changelog.sh @@ -5,9 +5,12 @@ set -euo pipefail # Script para generar el archivo de cambios del crate indicado. # Uso: # ./tools/changelog.sh [--stage] -# Ejemplo: +# Ejemplos: # ./tools/changelog.sh pagetop-macros 0.1.0 # Sólo genera archivo -# ./tools/changelog.sh pagetop 0.1.0 --stage # Prepara archivo para commit +# ./tools/changelog.sh pagetop 0.1.0 --stage # Genera y prepara para commit +# +# El modo --stage lo invoca pre-release-hook de cargo-release desde release.sh +# para añadir el archivo de cambios al commit de liberación de la versión. # ------------------------------------------------------------------------------ # Configuración @@ -103,23 +106,26 @@ else fi git-cliff --unreleased "${COMMON_ARGS[@]}" echo "CHANGELOG generated at '$CHANGELOG_FILE'" +echo "" -# Pregunta por la revisión del archivo de cambios generado -echo "Do you want to review the changelog before continuing? [y/N]" -read -r REPLY +# Permite revisar (y editar) el archivo de cambios antes de continuar +read -r -p "Do you want to review the changelog before continuing? [y/N] " REPLY +echo "" if [[ "$REPLY" =~ ^[Yy]$ ]]; then ${EDITOR:-nano} "$CHANGELOG_FILE" fi -echo "Do you want to proceed with the release of $CRATE? [y/N]" -read -r REPLY -echo + +# Confirmación antes de proceder con la publicación +read -r -p "Do you want to proceed with the release of $CRATE? [y/N] " REPLY +echo "" if [[ ! "$REPLY" =~ ^[Yy]$ ]]; then echo "Aborting release process." >&2 + git restore --worktree -- . exit 1 fi # Si hay cambios y procede, añade al stage (cargo-release hará el commit) -if [[ -n $(git status --porcelain -- "$CHANGELOG_FILE") ]]; then +if [[ -n "$(git status --porcelain -- "$CHANGELOG_FILE")" ]]; then if [[ "$STAGE" == "--stage" ]]; then git add "$CHANGELOG_FILE" echo "Staged $CHANGELOG_FILE for commit"