fix: fix automatic changelog creation with PSR v10

- Remove deprecated changelog_file from [tool.semantic_release.changelog]
  in pyproject.toml (already set under default_templates)
- Add <!-- version list --> insertion flag to CHANGELOG.md so PSR v10's
  update mode can find where to insert new version entries
- Fix generate_build_metadata.sh to use $NEW_VERSION env var (set by PSR
  before running build_command) instead of incorrectly syncing VERSION
  from the previous git tag

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-23 18:54:18 +00:00
parent a443c13491
commit 7f3e8312de
3 changed files with 8 additions and 37 deletions
+1 -17
View File
@@ -8,23 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
> **This CHANGELOG is automatically generated and maintained by [python-semantic-release](https://github.com/python-semantic-release/python-semantic-release). Do not edit it manually.**
> New entries are prepended automatically on every merge to `main` that triggers a version bump.
---
## [Unreleased]
### Fixed
- Fixed CHANGELOG.md not being updated by semantic-release (`autoescape = true` Jinja2 bug)
- Added explicit `changelog_file`, `mode = "update"`, and `output_format = "md"` to semantic-release config
- Added fallback `semantic-release changelog` step in release workflow for safety
### Documentation
- Added Documentation-First Development section to CONTRIBUTING.md and AGENTIC_CODING.md
- Fixed README.md quick-start commands (`cd DocuElevate`, `cp .env.demo .env`)
- Added note to README.md screenshots section indicating they may lag the current UI
- Updated TODO.md to reflect current version (v0.40.0) and completed tasks
- Retroactively populated CHANGELOG.md with all post-v0.5.0 changes
---
<!-- version list -->
## [0.40.0] - 2026-02-23
-1
View File
@@ -49,7 +49,6 @@ match = "main"
prerelease = false
[tool.semantic_release.changelog]
changelog_file = "CHANGELOG.md"
mode = "update"
exclude_commit_patterns = [
"^chore\\(release\\):",
+7 -19
View File
@@ -55,31 +55,19 @@ else
GIT_BRANCH="unknown"
fi
# Read VERSION file
if [ -f "VERSION" ]; then
# Update VERSION file: prefer PSR's NEW_VERSION env var, then existing file
if [ -n "${NEW_VERSION}" ]; then
echo "${NEW_VERSION}" > VERSION
VERSION="${NEW_VERSION}"
echo "✓ VERSION (from NEW_VERSION env): ${VERSION}"
elif [ -f "VERSION" ]; then
VERSION=$(cat VERSION | tr -d '\n')
echo "✓ VERSION (from file): ${VERSION}"
else
echo "⚠ Warning: VERSION file not found"
echo "⚠ Warning: VERSION file not found and NEW_VERSION not set"
VERSION="unknown"
fi
# Try to derive version from the latest git tag (semantic-release creates vX.Y.Z tags)
if git rev-parse --git-dir > /dev/null 2>&1; then
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
if [ -n "${LATEST_TAG}" ]; then
# Strip the 'v' prefix from the tag (e.g., v0.9.1 -> 0.9.1)
TAG_VERSION="${LATEST_TAG#v}"
if [ "${TAG_VERSION}" != "${VERSION}" ]; then
echo "⚠ VERSION file (${VERSION}) is out of sync with latest tag (${TAG_VERSION})"
echo " Updating VERSION file to ${TAG_VERSION}"
echo "${TAG_VERSION}" > VERSION
VERSION="${TAG_VERSION}"
echo "✓ VERSION (updated from tag): ${VERSION}"
fi
fi
fi
# Generate RUNTIME_INFO with combined metadata
cat > RUNTIME_INFO << EOF
DocuElevate Build Information