feat: add GitHub Actions workflow for automated release creation and update CHANGELOG.md structure

This commit is contained in:
2025-02-16 10:26:43 +01:00
parent 2f34a0ca4e
commit 7ccacec68f
10 changed files with 191 additions and 3 deletions

View File

@@ -0,0 +1,36 @@
import os
import re
from datetime import datetime
def get_version():
with open('../platformio.ini', 'r') as f:
content = f.read()
version_match = re.search(r'version\s*=\s*"([^"]+)"', content)
return version_match.group(1) if version_match else None
def update_changelog():
version = get_version()
today = datetime.now().strftime('%Y-%m-%d')
changelog_template = f"""## [{version}] - {today}
### Added
-
### Changed
-
### Fixed
-
"""
with open('../CHANGELOG.md', 'r') as f:
content = f.read()
# Insert new version template after the header
updated_content = content.replace("# Changelog\n", f"# Changelog\n\n{changelog_template}")
with open('../CHANGELOG.md', 'w') as f:
f.write(updated_content)
if __name__ == "__main__":
update_changelog()