From 62e78ace5c818f6c1a1d722247f2e6896ba53da3 Mon Sep 17 00:00:00 2001 From: fujie Date: Mon, 9 Mar 2026 20:52:43 +0800 Subject: [PATCH] chore(workflow): optimize release notes formatting and link visibility - Removed redundant H1 title from automated release generation - Compacted README links in version change summary to same line - Streamlined release notes by removing verbose commit logs and redundant guides - Updated release-prep skill to enforce professional GitHub release standards --- .github/workflows/release.yml | 55 ++++++------------------------ scripts/extract_plugin_versions.py | 5 ++- 2 files changed, 12 insertions(+), 48 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b53d590..237e10e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -436,54 +436,34 @@ jobs: CHANGED_PLUGIN_TITLE: ${{ needs.check-changes.outputs.changed_plugin_title }} CHANGED_PLUGIN_VERSION: ${{ needs.check-changes.outputs.changed_plugin_version }} DETECTED_CHANGES: ${{ needs.check-changes.outputs.release_notes }} - COMMITS: ${{ steps.commits.outputs.commits }} DOC_FILES: ${{ needs.check-changes.outputs.changed_doc_files }} run: | > release_notes.md - if [ -n "$CHANGED_PLUGIN_TITLE" ] && [ -n "$CHANGED_PLUGIN_VERSION" ]; then - echo "# $CHANGED_PLUGIN_TITLE v$CHANGED_PLUGIN_VERSION" >> release_notes.md - echo "" >> release_notes.md - elif [ -n "$TITLE" ]; then - echo "# $TITLE" >> release_notes.md - echo "" >> release_notes.md - fi - - # 1. Release notes from v*.md files (highest priority, shown first) + # 1. Primary content from v*.md files (highest priority) if [ -n "$DOC_FILES" ]; then RELEASE_NOTE_FILES=$(echo "$DOC_FILES" | grep -E '^plugins/.*/v[^/]*\.md$' | grep -v '_CN\.md$' || true) if [ -n "$RELEASE_NOTE_FILES" ]; then while IFS= read -r file; do [ -z "$file" ] && continue if [ -f "$file" ]; then - python3 -c "import pathlib, re; file_path = pathlib.Path(r'''$file'''); text = file_path.read_text(encoding='utf-8'); text = re.sub(r'^#\\s+.+?(?:\\r?\\n)+', '', text, count=1, flags=re.MULTILINE); print(text.lstrip().rstrip())" >> release_notes.md + # Extract content, removing any H1 title from the file to avoid duplication + python3 -c "import pathlib, re; file_path = pathlib.Path(r'''$file'''); text = file_path.read_text(encoding='utf-8'); text = re.sub(r'^#\s+.+?(?:\r?\n)+', '', text, count=1, flags=re.MULTILINE); print(text.lstrip().rstrip())" >> release_notes.md echo "" >> release_notes.md fi done <<< "$RELEASE_NOTE_FILES" fi fi - # 2. Plugin version changes detected by script - if [ -z "$CHANGED_PLUGIN_TITLE" ] && [ -z "$CHANGED_PLUGIN_VERSION" ] && [ -n "$TITLE" ]; then - echo "## $TITLE" >> release_notes.md - echo "" >> release_notes.md - fi - + # 2. Automated plugin version change summary if [ -n "$DETECTED_CHANGES" ] && ! echo "$DETECTED_CHANGES" | grep -q "No changes detected"; then - echo "## What's Changed" >> release_notes.md + echo "## Version Changes" >> release_notes.md echo "" >> release_notes.md echo "$DETECTED_CHANGES" >> release_notes.md echo "" >> release_notes.md fi - # 3. Commits (Conventional Commits format with body) - if [ -n "$COMMITS" ]; then - echo "## Commits" >> release_notes.md - echo "" >> release_notes.md - echo "$COMMITS" >> release_notes.md - echo "" >> release_notes.md - fi - + # 3. Manual additional notes from workflow dispatch if [ -n "$NOTES" ]; then echo "## Additional Notes" >> release_notes.md echo "" >> release_notes.md @@ -493,30 +473,15 @@ jobs: cat >> release_notes.md << 'EOF' - ## Download - - 📦 **Download the updated plugin files below** - - ### Installation - - #### From OpenWebUI Community - 1. Open OpenWebUI Admin Panel - 2. Navigate to Functions/Tools - 3. Search for the plugin name - 4. Click Install - - #### Manual Installation - 1. Download the plugin file (`.py`) from the assets below - 2. Open OpenWebUI Admin Panel → Functions - 3. Click "Create Function" → Import - 4. Paste the plugin code - --- - 📚 [Documentation](https://fu-jie.github.io/openwebui-extensions/) + 📚 [Documentation Portal](https://fu-jie.github.io/openwebui-extensions/) 🐛 [Report Issues](https://github.com/Fu-Jie/openwebui-extensions/issues) EOF + echo "=== Final Release Notes ===" + cat release_notes.md + echo "=== Release Notes ===" cat release_notes.md diff --git a/scripts/extract_plugin_versions.py b/scripts/extract_plugin_versions.py index d8d3805..bccb7f3 100644 --- a/scripts/extract_plugin_versions.py +++ b/scripts/extract_plugin_versions.py @@ -285,9 +285,8 @@ def format_release_notes( prev_ver = prev_manifest.get("version") or prev.get("version") readme_url = _get_readme_url(curr.get("file_path", "")) - lines.append(f"- **{curr_title}**: v{prev_ver} → v{curr_ver}") - if readme_url: - lines.append(f" - 📖 [README]({readme_url})") + readme_link = f" | [📖 README]({readme_url})" if readme_url else "" + lines.append(f"- **{curr_title}**: v{prev_ver} → v{curr_ver}{readme_link}") lines.append("") if comparison["removed"] and not ignore_removed: