Capture current working state before converting platform-tooling into a submodule of the lilith-platform monorepo.
65 lines
1.6 KiB
Bash
Executable file
65 lines
1.6 KiB
Bash
Executable file
#!/bin/bash
|
|
#
|
|
# Release Notes Generation Library
|
|
#
|
|
# Generates markdown release notes from git commit history.
|
|
#
|
|
|
|
set -e
|
|
set -u
|
|
|
|
generate_release_notes() {
|
|
local LAST_TAG="$1"
|
|
local NEW_TAG="$2"
|
|
local DEPLOYED_SERVICES="${3:-}"
|
|
|
|
cat <<EOF
|
|
# Release $NEW_TAG
|
|
|
|
**Release Date**: $(date -u +"%Y-%m-%d %H:%M UTC")
|
|
**Previous Version**: $LAST_TAG
|
|
**Commits**: $(git log ${LAST_TAG}..HEAD --oneline --no-merges | wc -l)
|
|
|
|
## Changes
|
|
|
|
### Features
|
|
$(git log ${LAST_TAG}..HEAD --oneline --no-merges --grep='^feat' | sed 's/^[a-f0-9]* /- /' || echo "- None")
|
|
|
|
### Fixes
|
|
$(git log ${LAST_TAG}..HEAD --oneline --no-merges --grep='^fix' | sed 's/^[a-f0-9]* /- /' || echo "- None")
|
|
|
|
### Improvements
|
|
$(git log ${LAST_TAG}..HEAD --oneline --no-merges --grep='^refactor\|^perf' | sed 's/^[a-f0-9]* /- /' || echo "- None")
|
|
|
|
### Other Changes
|
|
$(git log ${LAST_TAG}..HEAD --oneline --no-merges --grep='^chore\|^docs\|^test' | head -5 | sed 's/^[a-f0-9]* /- /' || echo "- None")
|
|
|
|
## Deployment
|
|
|
|
$(if [ -n "$DEPLOYED_SERVICES" ]; then
|
|
echo "### Deployed Services"
|
|
echo "$DEPLOYED_SERVICES" | tr ' ' '\n' | sed 's/^/- /'
|
|
else
|
|
echo "Full deployment (all services)"
|
|
fi)
|
|
|
|
## Build Information
|
|
|
|
- **Commit**: $(git rev-parse HEAD)
|
|
- **Branch**: $(git rev-parse --abbrev-ref HEAD)
|
|
- **Build Time**: $(date -u +"%Y-%m-%d %H:%M:%S UTC")
|
|
- **Deployment Method**: Blue-green zero-downtime
|
|
|
|
## Verification
|
|
|
|
Health checks passed for all deployed services.
|
|
Zero-downtime deployment completed successfully.
|
|
|
|
---
|
|
|
|
🤖 Generated with Release Automation System
|
|
EOF
|
|
}
|
|
|
|
# Export functions
|
|
export -f generate_release_notes
|