Automate releases from PR titles and clean up CI workflows.
Add release and PR title checks, shared CI scripts, Gitea PR template, and align pyproject.toml to v0.3.1. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
co-authored by
Cursor
parent
2bb361e3a3
commit
a8491c005c
Executable
+54
@@ -0,0 +1,54 @@
|
||||
#!/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}
|
||||
|
||||
$(git log "${PREV_TAG}..HEAD" --pretty=format:'- %h %s' || true)"
|
||||
else
|
||||
NOTES="${NOTES}
|
||||
|
||||
## Changes
|
||||
|
||||
$(git log --pretty=format:'- %h %s' -20 || true)"
|
||||
fi
|
||||
|
||||
if [[ -n "${GITHUB_OUTPUT:-}" ]]; then
|
||||
{
|
||||
echo 'body<<EOF'
|
||||
echo "$NOTES"
|
||||
echo 'EOF'
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "$NOTES"
|
||||
fi
|
||||
Reference in New Issue
Block a user