Compare commits

..

4 Commits

Author SHA1 Message Date
6d8358cbb9 docs: update changelog and header for version v1.3.60
All checks were successful
Release Workflow / detect-provider (push) Successful in 2s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 2m48s
2025-02-22 20:06:25 +01:00
1f3a67634f docs: update webpages for version v1.3.60 2025-02-22 20:06:25 +01:00
09969b644e feat: remove automatic git push from changelog update script 2025-02-22 20:06:20 +01:00
deb7abd102 feat: implement release notes generation with categorized changes since last tag 2025-02-22 20:00:42 +01:00
5 changed files with 68 additions and 41 deletions

View File

@ -66,14 +66,33 @@ jobs:
VERSION=$(grep '^version = ' platformio.ini | cut -d'"' -f2)
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Read CHANGELOG.md
id: changelog
- name: Generate Release Notes
id: release_notes
run: |
VERSION=${{ steps.get_version.outputs.VERSION }}
CHANGELOG=$(awk "/## \\[$VERSION\\]/{p=1;print;next} /## \\[/{p=0} p" CHANGELOG.md)
echo "CHANGES<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
if [ -n "$LAST_TAG" ]; then
echo "CHANGES<<EOF" >> $GITHUB_OUTPUT
echo "Changes since $LAST_TAG:" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
# Get commits since last tag and categorize them
echo "### Added" >> $GITHUB_OUTPUT
git log $LAST_TAG..HEAD --pretty=format:%s | grep -iE '^(feat|add|new)' | sed 's/^feat: /- /' >> $GITHUB_OUTPUT || true
echo "" >> $GITHUB_OUTPUT
echo "### Fixed" >> $GITHUB_OUTPUT
git log $LAST_TAG..HEAD --pretty=format:%s | grep -iE '^fix' | sed 's/^fix: /- /' >> $GITHUB_OUTPUT || true
echo "" >> $GITHUB_OUTPUT
echo "### Changed" >> $GITHUB_OUTPUT
git log $LAST_TAG..HEAD --pretty=format:%s | grep -ivE '^(feat|fix|add|new)' | sed 's/^/- /' >> $GITHUB_OUTPUT || true
echo "EOF" >> $GITHUB_OUTPUT
else
echo "CHANGES<<EOF" >> $GITHUB_OUTPUT
echo "Initial Release" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
fi
- name: Determine Gitea URL
id: gitea_url
@ -122,7 +141,7 @@ jobs:
# Erstelle zuerst den Release ohne Dateien
echo "Debug: Creating release..."
RELEASE_DATA="{\"tag_name\":\"v${VERSION}\",\"name\":\"v${VERSION}\",\"body\":\"${{ steps.changelog.outputs.CHANGES }}\"}"
RELEASE_DATA="{\"tag_name\":\"v${VERSION}\",\"name\":\"v${VERSION}\",\"body\":\"${{ steps.release_notes.outputs.CHANGES }}\"}"
RELEASE_RESPONSE=$(curl -s -w "\n%{http_code}" \
-X POST \

View File

@ -73,14 +73,33 @@ jobs:
VERSION=$(grep '^version = ' platformio.ini | cut -d'"' -f2)
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Read CHANGELOG.md
id: changelog
- name: Generate Release Notes
id: release_notes
run: |
VERSION=${{ steps.get_version.outputs.VERSION }}
CHANGELOG=$(awk "/## \\[$VERSION\\]/{p=1;print;next} /## \\[/{p=0} p" CHANGELOG.md)
echo "CHANGES<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
if [ -n "$LAST_TAG" ]; then
echo "CHANGES<<EOF" >> $GITHUB_OUTPUT
echo "Changes since $LAST_TAG:" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
# Get commits since last tag and categorize them
echo "### Added" >> $GITHUB_OUTPUT
git log $LAST_TAG..HEAD --pretty=format:%s | grep -iE '^(feat|add|new)' | sed 's/^feat: /- /' >> $GITHUB_OUTPUT || true
echo "" >> $GITHUB_OUTPUT
echo "### Fixed" >> $GITHUB_OUTPUT
git log $LAST_TAG..HEAD --pretty=format:%s | grep -iE '^fix' | sed 's/^fix: /- /' >> $GITHUB_OUTPUT || true
echo "" >> $GITHUB_OUTPUT
echo "### Changed" >> $GITHUB_OUTPUT
git log $LAST_TAG..HEAD --pretty=format:%s | grep -ivE '^(feat|fix|add|new)' | sed 's/^/- /' >> $GITHUB_OUTPUT || true
echo "EOF" >> $GITHUB_OUTPUT
else
echo "CHANGES<<EOF" >> $GITHUB_OUTPUT
echo "Initial Release" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
fi
- name: Create GitHub Release
env:
@ -110,7 +129,7 @@ jobs:
if [ -n "$FILES_TO_UPLOAD" ]; then
gh release create "v${VERSION}" \
--title "Release ${VERSION}" \
--notes "${{ steps.changelog.outputs.CHANGES }}" \
--notes "${{ steps.release_notes.outputs.CHANGES }}" \
$FILES_TO_UPLOAD
else
echo "Error: No files found to upload"

View File

@ -1,5 +1,14 @@
# Changelog
## [1.3.60] - 2025-02-22
### Added
- remove automatic git push from changelog update script
- implement release notes generation with categorized changes since last tag
### Changed
- update webpages for version v1.3.60
## [1.3.59] - 2025-02-22
### Added
- implement enhanced update progress handling and WebSocket notifications

View File

@ -9,7 +9,7 @@
; https://docs.platformio.org/page/projectconf.html
[common]
version = "1.3.59"
version = "1.3.60"
#test

View File

@ -64,29 +64,10 @@ def get_changes_from_git():
return changes
def push_changes(version):
"""Push changes to upstream"""
try:
# Stage the CHANGELOG.md
subprocess.run(['git', 'add', 'CHANGELOG.md'], check=True)
# Commit the changelog
commit_msg = f"docs: update changelog for version {version}"
subprocess.run(['git', 'commit', '-m', commit_msg], check=True)
# Push to origin (local)
subprocess.run(['git', 'push', 'origin'], check=True)
print("Successfully pushed to origin")
except subprocess.CalledProcessError as e:
print(f"Error during git operations: {e}")
return False
return True
def update_changelog():
print("Starting changelog update...") # Add this line
print("Starting changelog update...")
version = get_version()
print(f"Current version: {version}") # Add this line
print(f"Current version: {version}")
today = datetime.now().strftime('%Y-%m-%d')
script_dir = os.path.dirname(os.path.abspath(__file__))
@ -111,7 +92,7 @@ def update_changelog():
if not os.path.exists(changelog_path):
with open(changelog_path, 'w') as f:
f.write(f"# Changelog\n\n{changelog_entry}")
push_changes(version)
print(f"Created new changelog file with version {version}")
else:
with open(changelog_path, 'r') as f:
content = f.read()
@ -120,7 +101,7 @@ def update_changelog():
updated_content = content.replace("# Changelog\n", f"# Changelog\n\n{changelog_entry}")
with open(changelog_path, 'w') as f:
f.write(updated_content)
push_changes(version)
print(f"Added new version {version} to changelog")
else:
# Version existiert bereits, aktualisiere die bestehenden Einträge
version_pattern = f"## \\[{version}\\] - \\d{{4}}-\\d{{2}}-\\d{{2}}"
@ -143,7 +124,6 @@ def update_changelog():
with open(changelog_path, 'w') as f:
f.write(updated_content)
push_changes(version)
print(f"Updated entries for version {version}")
if __name__ == "__main__":