Browse Source

feat(changelog): add CHANGELOG.md and automate release notes (#1313)

- Add CHANGELOG.md following Keep a Changelog format
- Update GitHub Action to extract [Unreleased] section for release notes
- Include changelog content in GitHub releases automatically

Fixes #1296
Christian Lempa 6 months ago
parent
commit
e1b1f714e1
2 changed files with 46 additions and 0 deletions
  1. 24 0
      .github/workflows/release-create-cli-release.yaml
  2. 22 0
      CHANGELOG.md

+ 24 - 0
.github/workflows/release-create-cli-release.yaml

@@ -110,6 +110,24 @@ jobs:
       #     echo "Publishing to PyPI..."
       #     twine upload dist/*
 
+      - name: Extract changelog for this version
+        id: changelog
+        run: |
+          # Extract the [Unreleased] section from CHANGELOG.md
+          CHANGELOG=$(awk '/^## \[Unreleased\]/{flag=1; next} /^## \[/{flag=0} flag' CHANGELOG.md)
+          
+          if [ -z "$CHANGELOG" ]; then
+            echo "No changelog entries found for this release"
+            CHANGELOG="See commit history for details."
+          fi
+          
+          # Save to output using heredoc to handle multiline
+          {
+            echo 'content<<EOF'
+            echo "$CHANGELOG"
+            echo EOF
+          } >> $GITHUB_OUTPUT
+
       - name: Create GitHub Release
         uses: softprops/action-gh-release@v2
         with:
@@ -118,6 +136,12 @@ jobs:
           body: |
             ## Boilerplates CLI ${{ steps.version.outputs.tag }}
 
+            ${{ steps.changelog.outputs.content }}
+
+            ---
+
+            ### Installation
+
             Install using the installation script:
             ```bash
             curl -fsSL https://raw.githubusercontent.com/christianlempa/boilerplates/main/scripts/install.sh | bash

+ 22 - 0
CHANGELOG.md

@@ -0,0 +1,22 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [Unreleased]
+
+### Changed
+- Improved error handling and display output consistency
+
+### Fixed
+- Repository fetch fails when library directory already exists
+- Install script reliability improvements
+
+## [0.0.4] - 2025-01-XX
+
+Initial public release with core CLI functionality.
+
+[unreleased]: https://github.com/christianlempa/boilerplates/compare/v0.0.4...HEAD
+[0.0.4]: https://github.com/christianlempa/boilerplates/releases/tag/v0.0.4