Skip to content

Commit 8fe2d77

Browse files
Merge pull request #56 from BhaskarKulshrestha/feature/automated-release-notes
Feature/automated release notes PR URL: #56
2 parents 4dd0bc0 + ee445e3 commit 8fe2d77

12 files changed

+1161
-12
lines changed

.github/pull_request_template.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@
22
Explain the change in 1–3 sentences. Reference any related issues (e.g. Closes #123).
33

44
## Type of Change
5-
- [ ] Feature
6-
- [ ] Bug fix
7-
- [ ] Chore / Refactor
8-
- [ ] Docs
9-
- [ ] Tests
10-
- [ ] CI / Build
11-
- [ ] Other
5+
<!-- Select the primary type of change. This helps with automated release note generation. -->
6+
- [ ] 🚀 **Feature** (`feat:`) - New functionality for users
7+
- [ ] 🐛 **Bug fix** (`fix:`) - Fixes an issue for users
8+
- [ ] ⚠️ **Breaking Change** (`feat!:` or `fix!:`) - Changes that break backward compatibility
9+
- [ ] 📚 **Docs** (`docs:`) - Documentation updates only
10+
- [ ] 🔧 **Chore / Refactor** (`chore:`, `refactor:`) - Internal changes, no user impact
11+
- [ ] 🧪 **Tests** (`test:`) - Test additions or updates
12+
- [ ] 🚀 **CI / Build** (`ci:`) - Build system or CI changes
13+
- [ ] 📦 **Dependencies** (`deps:`) - Dependency updates
14+
- [ ] 🎉 **Other** - Changes that don't fit the above categories
15+
16+
## Release Notes Impact
17+
<!-- This helps generate better automated release notes -->
18+
- [ ] **User-facing change** - Should be included in release notes
19+
- [ ] **Internal change only** - No need to include in release notes
1220

1321
## Motivation / Context
1422
Why is this change needed? What problem does it solve or what capability does it add?
@@ -42,12 +50,21 @@ node bin/index.js demo --services node --no-install --yes
4250
```
4351
Result: ✅ / ❌
4452

53+
## Breaking Changes & Migration
54+
<!-- If this is a breaking change, provide details for users -->
55+
**Breaking changes:**
56+
57+
**Migration steps:**
58+
59+
**Configuration changes needed:**
60+
4561
## Screenshots / Logs (Optional)
4662
Add any helpful output (chalk-styled CLI messages, error reproduction, etc.).
4763

4864
## Docs
4965
- [ ] Updated `README.md` if needed
5066
- [ ] Updated `.github/copilot-instructions.md` if internal conventions changed
67+
- [ ] Added/updated relevant documentation for user-facing changes
5168
- [ ] Not applicable
5269

5370
## Checklist

.github/release-notes-config.yml

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
# Release Notes Configuration
2+
3+
# This file contains configuration for the automated release notes generation system.
4+
# It defines how commits are categorized and what patterns to look for.
5+
6+
# Commit categorization patterns (regex patterns, case-insensitive)
7+
categorization:
8+
features:
9+
patterns:
10+
- "^feat(\\(.*\\))?:"
11+
- "^add "
12+
- "^implement "
13+
- "new feature"
14+
- "added support"
15+
16+
bugfixes:
17+
patterns:
18+
- "^fix(\\(.*\\))?:"
19+
- "^bug "
20+
- "^patch "
21+
- "resolve.*issue"
22+
- "fixed.*problem"
23+
24+
breaking_changes:
25+
patterns:
26+
- "^feat(\\(.*\\))?!:"
27+
- "^fix(\\(.*\\))?!:"
28+
- "breaking"
29+
- "^BREAKING CHANGE"
30+
- "backwards incompatible"
31+
32+
documentation:
33+
patterns:
34+
- "^docs(\\(.*\\))?:"
35+
- "documentation"
36+
- "readme"
37+
- "update.*docs"
38+
- "add.*docs"
39+
40+
internal:
41+
patterns:
42+
- "^chore(\\(.*\\))?:"
43+
- "^ci(\\(.*\\))?:"
44+
- "^test(\\(.*\\))?:"
45+
- "^refactor(\\(.*\\))?:"
46+
- "^build(\\(.*\\))?:"
47+
- "^perf(\\(.*\\))?:"
48+
- "internal changes"
49+
- "code cleanup"
50+
51+
dependencies:
52+
patterns:
53+
- "^deps(\\(.*\\))?:"
54+
- "dependencies"
55+
- "package.*update"
56+
- "bump.*version"
57+
- "upgrade.*to"
58+
- "update.*dependency"
59+
60+
# Section configuration
61+
sections:
62+
features:
63+
title: "🚀 Features Added"
64+
description: "New functionality and capabilities added in this release"
65+
66+
bugfixes:
67+
title: "🐛 Bug Fixes"
68+
description: "Issues and problems resolved in this release"
69+
70+
breaking_changes:
71+
title: "⚠️ Breaking Changes"
72+
description: "Changes that may break backward compatibility"
73+
priority: 1 # Show first after main description
74+
75+
documentation:
76+
title: "📚 Documentation"
77+
description: "Documentation updates and improvements"
78+
79+
internal:
80+
title: "🔧 Internal/DevOps"
81+
description: "Internal improvements, build system, and development tooling changes"
82+
83+
dependencies:
84+
title: "📦 Dependencies"
85+
description: "Dependency updates and package management changes"
86+
87+
other:
88+
title: "🎉 Other Changes"
89+
description: "Other notable changes that don't fit the above categories"
90+
91+
refactoring:
92+
title: "🔄 Refactoring & Performance"
93+
description: "Code quality improvements and performance optimizations"
94+
95+
# Template configuration
96+
template:
97+
# Whether to include sections that have no items
98+
include_empty_sections: false
99+
100+
# Maximum number of commits to show per section (0 = unlimited)
101+
max_commits_per_section: 0
102+
103+
# Whether to include commit hashes in the output
104+
include_commit_hashes: true
105+
106+
# Whether to include author information
107+
include_authors: true
108+
109+
# Date format for the release
110+
date_format: "YYYY-MM-DD"
111+
112+
# Contributors configuration
113+
contributors:
114+
# Whether to include a contributors section
115+
include_contributors: true
116+
117+
# How to format contributor names
118+
format: "@{username}"
119+
120+
# Whether to exclude bot accounts
121+
exclude_bots: true
122+
123+
# List of usernames to exclude from contributors list
124+
exclude_users:
125+
- "dependabot[bot]"
126+
- "github-actions[bot]"
127+
128+
# Validation rules
129+
validation:
130+
# Minimum number of commits required for a release
131+
min_commits: 1
132+
133+
# Whether to fail if no categorized changes are found
134+
require_categorized_changes: false
135+
136+
# Whether to validate that breaking changes have migration notes
137+
require_breaking_change_notes: true
138+
139+
# Custom replacements for commit messages (useful for cleaning up automated commits)
140+
message_replacements:
141+
- pattern: "^Merge pull request #\\d+ from .*"
142+
replacement: "" # Remove merge commit messages
143+
- pattern: "^Merge branch '.*' into .*"
144+
replacement: "" # Remove branch merge messages
145+
- pattern: "\\(#(\\d+)\\)"
146+
replacement: "(#$1)" # Normalize PR references
147+
148+
# Integration settings
149+
integrations:
150+
github:
151+
# Whether to link to GitHub commits
152+
link_commits: true
153+
154+
# Whether to link to GitHub issues/PRs
155+
link_issues: true
156+
157+
# Base URL for the repository
158+
base_url: "https://github.com/{owner}/{repo}"
159+
160+
npm:
161+
# Whether to include npm installation instructions
162+
include_install_instructions: true
163+
164+
# Package name for installation instructions
165+
package_name: "create-polyglot"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!-- This file tracks improvements to the release notes system -->

.github/release-notes-template.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Release Notes Template
2+
3+
This template is used to automatically generate release notes for create-polyglot.
4+
5+
## Release Notes for v{version}
6+
7+
### 🚀 Features Added
8+
{features}
9+
10+
### 🐛 Bug Fixes
11+
{bugfixes}
12+
13+
### ⚠️ Breaking Changes
14+
{breaking}
15+
16+
### 📚 Documentation
17+
{documentation}
18+
19+
### 🔧 Internal/DevOps
20+
{internal}
21+
22+
### 📦 Dependencies
23+
{dependencies}
24+
25+
### 🎉 Other Changes
26+
{other}
27+
28+
### 🔄 Refactoring & Performance
29+
{refactoring}
30+
31+
---
32+
33+
**Full Changelog**: {compare_url}
34+
35+
## What's Changed Since Last Release
36+
37+
{commits}
38+
39+
## Contributors
40+
41+
Thanks to all the contributors who made this release possible!
42+
43+
{contributors}
44+
45+
---
46+
47+
### Installation
48+
49+
```bash
50+
npm install -g create-polyglot@{version}
51+
# or
52+
npx create-polyglot@{version} init my-project
53+
```
54+
55+
### Upgrade Notes
56+
57+
{upgrade_notes}
58+
59+
### Known Issues
60+
61+
{known_issues}

.github/workflows/npm-publish.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,33 @@ on:
88
types: [created]
99

1010
jobs:
11+
generate-release-notes:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
pull-requests: read
16+
steps:
17+
- name: Trigger release notes generation
18+
uses: actions/github-script@v7
19+
with:
20+
github-token: ${{ secrets.GITHUB_TOKEN }}
21+
script: |
22+
// Trigger the release notes workflow
23+
await github.rest.actions.createWorkflowDispatch({
24+
owner: context.repo.owner,
25+
repo: context.repo.repo,
26+
workflow_id: 'release-notes.yml',
27+
ref: 'main',
28+
inputs: {
29+
tag_name: '${{ github.event.release.tag_name }}',
30+
target_commitish: '${{ github.event.release.target_commitish }}'
31+
}
32+
});
33+
console.log('Release notes generation triggered');
34+
35+
// Wait a bit for the workflow to complete
36+
await new Promise(resolve => setTimeout(resolve, 5000));
37+
1138
build:
1239
runs-on: ubuntu-latest
1340
steps:
@@ -22,7 +49,7 @@ jobs:
2249
- run: npm test
2350

2451
publish-npm:
25-
needs: build
52+
needs: [generate-release-notes, build]
2653
runs-on: ubuntu-latest
2754
steps:
2855
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)