feat: Add Changelog generation script for releases

This change automates the release workflow and reduces manual touch.
master
nirenjan 2026-03-12 12:06:24 -07:00
parent 6743c60dfd
commit cccb561020
3 changed files with 50 additions and 14 deletions

View File

@ -0,0 +1,38 @@
#!/usr/bin/env python3
"""Generate a changelog for the latest release and dump it to stdout"""
from pathlib import Path
def get_git_root():
script_path = Path(__file__).resolve()
# This is always going to reside at <git-root>/.github/scripts/*.py
scripts_dir = Path(script_path.parent)
gh_dir = Path(scripts_dir.parent)
return Path(gh_dir.parent)
def main():
git_root = get_git_root()
changelog_file = git_root / 'ChangeLog.md'
latest = False
with open(changelog_file) as cfd:
for line in cfd:
if line.startswith('## '):
if 'Unreleased' in line:
continue
if latest:
break
latest = True
continue
if latest:
print(line, end='')
if __name__ == '__main__':
main()

View File

@ -44,13 +44,17 @@ jobs:
sha256sum "$ASSET_NAME" > "${ASSET_NAME}.sha256sum"
cd ../..
- name: Generate changelog
run: ./.github/scripts/generate_changelog.py > ${{ github.workspace }}.CHANGELOG.txt
- name: Create Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
name: Release ${{ github.ref_name }}
body_path: ${{ github.workspace }}/CHANGELOG.txt
draft: false
prerelease: false
files: |

View File

@ -11,29 +11,23 @@ The format is based upon [Keep a Changelog].
### Added
- Updated build infrastructure to use Meson instead of Autotools.
- Added a [privacy policy](PRIVACY.md) to comply with GDPR/CCPA regulations.
- Added a [security policy](SECURITY.md) to help securely report
vulnerabilities.
- Added a [security policy](SECURITY.md) to help securely report vulnerabilities.
- Added Dependabot configuration to keep Action files up to date.
- Added a changelog script to automatically generate the latest release changelog.
### Changed
- **BREAKING**: Removed vendored inih package and switched build framework to
use inih from the system package manager.
- **BREAKING**: Removed vendored inih package and switched build framework to use inih from the system package manager.
- `x52bugreport` tool now strips out potentially identifying information.
- Removed the use of a 3rd party action to deploy generated Doxygen pages to the
gh-pages branch. This now uses the modern gh-pages deployment action.
- Updated release action to use softprops/action-gh-release@v2, since the
original actions are no longer maintained.
- Removed the use of a 3rd party action to deploy generated Doxygen pages to the gh-pages branch. This now uses the modern gh-pages deployment action.
- Updated release action to use softprops/action-gh-release@v2, since the original actions are no longer maintained.
### Deprecated
- Autotools build framework is now deprecated, and will be removed in the next
release.
- Autotools build framework is now deprecated, and will be removed in the next release.
### Fixed
- Github Actions updated to use current set of runners
- Fixed handling malformed UTF-8 input in libx52util
- Fixed boundary check issue in libx52util that incorrectly returned `-E2BIG` if
the output buffer was the exact size to capture the translated string and the
null terminator.
- Fixed boundary check issue in libx52util that incorrectly returned `-E2BIG` if the output buffer was the exact size to capture the translated string and the null terminator.
- Fixed potential UB in libx52-string-test
- Fixed NULL pointer dereference in `libx52_exit`
- Fixed errors identified by the GCC `-fanalyzer` flag