Compare commits
4 Commits
1b059c35f1
...
6d8358cbb9
Author | SHA1 | Date | |
---|---|---|---|
6d8358cbb9 | |||
1f3a67634f | |||
09969b644e | |||
deb7abd102 |
31
.github/workflows/gitea-release.yml
vendored
31
.github/workflows/gitea-release.yml
vendored
@ -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)
|
||||
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
|
||||
|
||||
if [ -n "$LAST_TAG" ]; then
|
||||
echo "CHANGES<<EOF" >> $GITHUB_OUTPUT
|
||||
echo "$CHANGELOG" >> $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 \
|
||||
|
31
.github/workflows/github-release.yml
vendored
31
.github/workflows/github-release.yml
vendored
@ -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)
|
||||
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
|
||||
|
||||
if [ -n "$LAST_TAG" ]; then
|
||||
echo "CHANGES<<EOF" >> $GITHUB_OUTPUT
|
||||
echo "$CHANGELOG" >> $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"
|
||||
|
@ -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
|
||||
|
@ -9,7 +9,7 @@
|
||||
; https://docs.platformio.org/page/projectconf.html
|
||||
|
||||
[common]
|
||||
version = "1.3.59"
|
||||
version = "1.3.60"
|
||||
|
||||
#test
|
||||
|
||||
|
@ -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__":
|
||||
|
Loading…
x
Reference in New Issue
Block a user