Skip to content

Commit a419797

Browse files
authored
Enhance release changelog generation and categorization in NuGet release workflow (#24)
* Switch changelog to HYBRID mode for PRs and direct commits * Fix label extractor regex flags for changelog builder * Expand test autolabeler glob to include lowercase .tests paths
1 parent 34563ea commit a419797

1 file changed

Lines changed: 134 additions & 0 deletions

File tree

.github/workflows/release-nuget.yml

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,140 @@ jobs:
178178
with:
179179
fetchReleaseInformation: true
180180
failOnError: false
181+
mode: "HYBRID"
182+
configurationJson: |
183+
{
184+
"template": "## What's Changed\n\n#{{CHANGELOG}}\n\n**Full Changelog**: #{{RELEASE_DIFF}}",
185+
"empty_template": "## What's Changed\n\nNo user-facing changes in this release.",
186+
"pr_template": "- #{{TITLE}} by @#{{AUTHOR}} in ##{{NUMBER}}",
187+
"commit_template": "- #{{TITLE}} by @#{{AUTHOR}} (`#{{MERGE_SHA}}`)",
188+
"categories": [
189+
{
190+
"title": "## 🚀 Features",
191+
"labels": ["enhancement", "feature", "feat"],
192+
"mode": "PR"
193+
},
194+
{
195+
"title": "## 🐛 Bug Fixes",
196+
"labels": ["bug", "fix", "bugfix"],
197+
"mode": "PR"
198+
},
199+
{
200+
"title": "## 📝 Documentation",
201+
"labels": ["docs", "documentation"],
202+
"mode": "PR"
203+
},
204+
{
205+
"title": "## 🧪 Tests",
206+
"labels": ["test", "tests", "qa"],
207+
"mode": "PR"
208+
},
209+
{
210+
"title": "## 🧰 Maintenance",
211+
"labels": ["chore", "ci", "build", "dependencies", "refactor"],
212+
"mode": "PR"
213+
},
214+
{
215+
"title": "## 🔒 Security",
216+
"labels": ["security"],
217+
"mode": "PR"
218+
},
219+
{
220+
"title": "## 🚀 Features (Direct Commits)",
221+
"mode": "COMMIT",
222+
"rules": [
223+
{
224+
"pattern": "^(feat|feature)(\\(.+\\))?:\\s+.+$",
225+
"flags": "giu",
226+
"on_property": "title"
227+
}
228+
]
229+
},
230+
{
231+
"title": "## 🐛 Bug Fixes (Direct Commits)",
232+
"mode": "COMMIT",
233+
"rules": [
234+
{
235+
"pattern": "^(fix|bugfix|bug)(\\(.+\\))?:\\s+.+$",
236+
"flags": "giu",
237+
"on_property": "title"
238+
}
239+
]
240+
},
241+
{
242+
"title": "## 🧰 Maintenance (Direct Commits)",
243+
"mode": "COMMIT",
244+
"rules": [
245+
{
246+
"pattern": "^(build|chore|ci|refactor|perf|style|test|docs)(\\(.+\\))?:\\s+.+$",
247+
"flags": "giu",
248+
"on_property": "title"
249+
}
250+
]
251+
},
252+
{
253+
"title": "## 📦 Other Direct Commits",
254+
"mode": "COMMIT",
255+
"rules": [
256+
{
257+
"pattern": "^.+$",
258+
"flags": "gu",
259+
"on_property": "title"
260+
}
261+
]
262+
}
263+
],
264+
"sort": {
265+
"order": "ASC",
266+
"on_property": "mergedAt"
267+
},
268+
"label_extractor": [
269+
{
270+
"pattern": "^(enhancement|feature|feat)$",
271+
"target": "$1",
272+
"flags": "i"
273+
},
274+
{
275+
"pattern": "^(bug|fix|bugfix)$",
276+
"target": "$1",
277+
"flags": "i"
278+
},
279+
{
280+
"pattern": "^(docs|documentation)$",
281+
"target": "$1",
282+
"flags": "i"
283+
},
284+
{
285+
"pattern": "^(test|tests|qa)$",
286+
"target": "$1",
287+
"flags": "i"
288+
},
289+
{
290+
"pattern": "^(chore|ci|build|dependencies|refactor)$",
291+
"target": "$1",
292+
"flags": "i"
293+
},
294+
{
295+
"pattern": "^security$",
296+
"target": "$0",
297+
"flags": "i"
298+
}
299+
],
300+
"autolabeler": [
301+
{
302+
"label": "docs",
303+
"files": ["**/*.md", "docs/**"]
304+
},
305+
{
306+
"label": "test",
307+
"files": ["**/*test*/**", "**/*tests*/**", "**/*.tests/**", "**/*.Tests/**"]
308+
},
309+
{
310+
"label": "ci",
311+
"files": [".github/workflows/**"]
312+
}
313+
]
314+
}
181315
env:
182316
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
183317

0 commit comments

Comments
 (0)