PR Title Check / check-title (pull_request) Successful in 8s
Test Python Package / unit-tests (pull_request) Successful in 12s
Code Quality Pipeline / code-quality (pull_request) Failing after 23s
Test Python Package / integration-tests (pull_request) Successful in 45s
Test Python Package / coverage-report (pull_request) Successful in 11s
Backfill version history from git tags and update CHANGELOG automatically on each release alongside Gitea release notes. Co-authored-by: Cursor <[email protected]>
55 lines
977 B
Bash
Executable File
55 lines
977 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
# shellcheck source=common.sh
|
|
source "${SCRIPT_DIR}/common.sh"
|
|
|
|
NEW_TAG="${1:-}"
|
|
SUMMARY="${2:-}"
|
|
PREV_TAG="${3:-}"
|
|
|
|
if [[ -z "$NEW_TAG" ]]; then
|
|
echo "Usage: generate-release-notes.sh <new-tag> [summary] [prev-tag]" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [[ -z "$PREV_TAG" ]]; then
|
|
PREV_TAG=$(git describe --tags --abbrev=0 "${NEW_TAG}^" 2>/dev/null || git describe --tags --abbrev=0 2>/dev/null || true)
|
|
fi
|
|
|
|
NOTES="## Summary"
|
|
if [[ -n "$SUMMARY" ]]; then
|
|
NOTES="${NOTES}
|
|
|
|
$(strip_bump_prefix "$SUMMARY")"
|
|
else
|
|
NOTES="${NOTES}
|
|
|
|
Automated release ${NEW_TAG}."
|
|
fi
|
|
|
|
if [[ -n "$PREV_TAG" ]]; then
|
|
NOTES="${NOTES}
|
|
|
|
## Changes since ${PREV_TAG}
|
|
|
|
$(commits_since "$PREV_TAG")"
|
|
else
|
|
NOTES="${NOTES}
|
|
|
|
## Changes
|
|
|
|
$(commits_between "" HEAD 20)"
|
|
fi
|
|
|
|
if [[ -n "${GITHUB_OUTPUT:-}" ]]; then
|
|
{
|
|
echo 'body<<EOF'
|
|
echo "$NOTES"
|
|
echo 'EOF'
|
|
} >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "$NOTES"
|
|
fi
|