From 7ba1ebbc38b2af1d8a0ef68002d36b3f38d6a2c6 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 15 Jul 2025 19:29:26 +0200 Subject: [PATCH] feat: ensure releases show only per-version changelog - Updated release.md documentation to emphasize per-release changelog behavior - Added fix-release-changelogs.sh script to update existing releases - Clarified that release script already extracts only specific version changes - Script can fix releases that incorrectly show full changelog history The release system already works correctly - it extracts only the specific version's changelog. The issue was with some existing releases that somehow got the full CHANGELOG.md content instead of the extracted version. --- mac/docs/RELEASE.md | 10 ++ mac/scripts/fix-release-changelogs.sh | 150 ++++++++++++++++++++++++++ 2 files changed, 160 insertions(+) create mode 100755 mac/scripts/fix-release-changelogs.sh diff --git a/mac/docs/RELEASE.md b/mac/docs/RELEASE.md index 4ebccf3d..aeb6fecc 100644 --- a/mac/docs/RELEASE.md +++ b/mac/docs/RELEASE.md @@ -254,6 +254,13 @@ All notable changes to VibeTunnel will be documented in this file. **CRITICAL**: The appcast generation relies on the local CHANGELOG.md file, NOT the GitHub release description. The changelog must be added to CHANGELOG.md BEFORE running the release script. +**IMPORTANT - Per-Release Changelog**: The release script automatically extracts ONLY the changelog section for the specific version being released. For example: +- When releasing beta.10, only the `## [1.0.0-beta.10]` section is used +- When releasing beta.11, only the `## [1.0.0-beta.11]` section is used +- This keeps GitHub release pages focused and prevents endless scrolling to find download links + +The script uses `changelog-to-html.sh` to extract the specific version's changes, not the entire changelog history. + ### Step 4: Create the Release āš ļø **CRITICAL UNDERSTANDING**: The release script parameters are ONLY for: @@ -304,6 +311,9 @@ The script will: ### Step 5: Verify Success - Check the GitHub releases page +- **IMPORTANT**: Verify the GitHub release shows ONLY the current version's changelog, not the entire history + - If it shows the full changelog, the release notes were not generated correctly + - The release should only show changes for that specific version (e.g., beta.10 shows only beta.10 changes) - Verify the appcast was updated correctly with proper changelog content - **Critical**: Verify the Sparkle signature is correct: ```bash diff --git a/mac/scripts/fix-release-changelogs.sh b/mac/scripts/fix-release-changelogs.sh new file mode 100755 index 00000000..bcff62b4 --- /dev/null +++ b/mac/scripts/fix-release-changelogs.sh @@ -0,0 +1,150 @@ +#!/bin/bash + +# ============================================================================= +# VibeTunnel Release Changelog Fixer +# ============================================================================= +# +# This script updates existing GitHub releases to show only their own changelog +# instead of the cumulative changelog history. +# +# USAGE: +# ./scripts/fix-release-changelogs.sh [--dry-run] +# +# OPTIONS: +# --dry-run Show what would be changed without actually updating +# +# ============================================================================= + +set -euo pipefail + +# Get script directory +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +PROJECT_ROOT="$(dirname "$SCRIPT_DIR")" + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' # No Color + +# Check for dry-run mode +DRY_RUN=false +if [[ "${1:-}" == "--dry-run" ]]; then + DRY_RUN=true + echo -e "${YELLOW}DRY RUN MODE - No changes will be made${NC}" +fi + +# Find changelog file +if [[ -f "$PROJECT_ROOT/../CHANGELOG.md" ]]; then + CHANGELOG_PATH="$PROJECT_ROOT/../CHANGELOG.md" +elif [[ -f "$PROJECT_ROOT/CHANGELOG.md" ]]; then + CHANGELOG_PATH="$PROJECT_ROOT/CHANGELOG.md" +else + echo -e "${RED}āŒ Error: CHANGELOG.md not found${NC}" + exit 1 +fi + +echo "šŸ“‹ Using changelog: $CHANGELOG_PATH" + +# Function to extract and format changelog for a specific version +generate_release_notes() { + local version="$1" + local changelog_html="" + + # Use the existing changelog-to-html.sh script + if [[ -x "$SCRIPT_DIR/changelog-to-html.sh" ]]; then + changelog_html=$("$SCRIPT_DIR/changelog-to-html.sh" "$version" "$CHANGELOG_PATH" 2>/dev/null || echo "") + fi + + # If we got HTML content, format it nicely for GitHub + if [[ -n "$changelog_html" ]] && [[ "$changelog_html" != *"Latest version of VibeTunnel"* ]]; then + # Convert HTML back to Markdown for GitHub (basic conversion) + echo "$changelog_html" | \ + sed 's/

/### /g' | \ + sed 's/<\/h3>//g' | \ + sed 's/

/## /g' | \ + sed 's/<\/h2>//g' | \ + sed 's/