Files
ESPDocs/scripts/release-notes.sh
T
Lucas RayanandClaude Sonnet 5.5 b1a4f4263f
Release / Plano (reaproveitar a imagem?) (push) Successful in 5s
Release / ci (push) Skipped
Release / Publica a imagem (linux/arm64) (push) Successful in 17s
Release / Cria a release no Gitea (push) Successful in 4s
release: 1.0.0 changelog and a job that creates the Gitea release
CHANGELOG.md in Portuguese, from the project history. The release job builds its
notes from the matching section. The new files are excluded from the image hash,
so the published image is reused. README points at the Gitea repository.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 12:39:22 -03:00

37 lines
1002 B
Bash
Executable File

#!/usr/bin/env bash
# Imprime as notas de uma release: a imagem publicada e a seção do CHANGELOG.md
# daquela versão (ou o log de commits desde a tag anterior, se não houver seção).
#
# scripts/release-notes.sh v1.2.3 git.exemplo.com/dono/projeto
set -euo pipefail
tag=${1:?uso: release-notes.sh <tag> <imagem>}
image=${2:?uso: release-notes.sh <tag> <imagem>}
version=${tag#v}
echo "## Imagem"
echo
echo '```'
echo "$image:$version"
echo '```'
echo
section=""
if [ -f CHANGELOG.md ]; then
section=$(awk -v head="## [$version]" '
index($0, head) == 1 { found = 1; next }
found && /^## \[/ { exit }
found && /^\[[^]]+\]: / { next }
found { print }
' CHANGELOG.md)
fi
if [ -n "$(printf '%s' "$section" | tr -d '[:space:]')" ]; then
printf '%s\n' "$section"
else
previous=$(git describe --tags --abbrev=0 "$tag^" 2>/dev/null || true)
echo "## Mudanças${previous:+ desde $previous}"
echo
git log --no-merges --format='- %s (%h)' "${previous:+$previous..}$tag"
fi