Skip to content

Commit 75ce9ff

Browse files
committed
build: release: add component summary
1 parent c6dd2dd commit 75ce9ff

1 file changed

Lines changed: 39 additions & 4 deletions

File tree

.github/workflows/maven-central.yml

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
# Fetch milestone ID for the link
7474
MILESTONE_ID=$(gh api repos/${{ github.repository }}/milestones -q ".[] | select(.title==\"$VERSION_NUM\") | .number")
7575
76-
# 1. Fetch BREAKING changes (requires the 'break-change' label)
76+
# 1. Fetch BREAKING changes
7777
gh issue list \
7878
--repo ${{ github.repository }} \
7979
--search "milestone:\"$VERSION_NUM\" label:break-change" \
@@ -82,7 +82,7 @@ jobs:
8282
--json title,number \
8383
--jq '.[] | "- \(.title) #\(.number)"' > breaking_issues.md
8484
85-
# 2. Fetch NEW features (requires 'feature', excludes 'break-change')
85+
# 2. Fetch NEW features
8686
gh issue list \
8787
--repo ${{ github.repository }} \
8888
--search "milestone:\"$VERSION_NUM\" label:feature -label:break-change" \
@@ -91,7 +91,7 @@ jobs:
9191
--json title,number \
9292
--jq '.[] | "- \(.title) #\(.number)"' > new_issues.md
9393
94-
# 3. Fetch DEPRECATED changes (requires 'deprecated', excludes 'break-change')
94+
# 3. Fetch DEPRECATED changes
9595
gh issue list \
9696
--repo ${{ github.repository }} \
9797
--search "milestone:\"$VERSION_NUM\" label:deprecated -label:break-change" \
@@ -100,7 +100,7 @@ jobs:
100100
--json title,number \
101101
--jq '.[] | "- \(.title) #\(.number)"' > deprecated_issues.md
102102
103-
# 4. Fetch OTHER changes (excludes 'feature', 'break-change', 'deprecated', and 'dependencies')
103+
# 4. Fetch OTHER changes
104104
gh issue list \
105105
--repo ${{ github.repository }} \
106106
--search "milestone:\"$VERSION_NUM\" -label:feature -label:break-change -label:deprecated -label:dependencies" \
@@ -109,6 +109,33 @@ jobs:
109109
--json title,number \
110110
--jq '.[] | "- \(.title) #\(.number)"' > other_issues.md
111111
112+
# 4.5 Fetch Component Summary (Group, Count, and Link Labels)
113+
# We grab labels and issue numbers, filter structural labels, group them,
114+
# count them, join the issue numbers, and output a Markdown table.
115+
gh issue list \
116+
--repo ${{ github.repository }} \
117+
--search "milestone:\"$VERSION_NUM\"" \
118+
--state all \
119+
--limit 1000 \
120+
--json number,labels \
121+
--jq '
122+
[ .[] as $issue | $issue.labels[].name |
123+
select(. != "bug" and . != "enhancement" and . != "feature" and . != "feedback" and . != "break-change" and . != "api-change" and . != "dependencies" and . != "deprecated") |
124+
{name: ., number: $issue.number} ] |
125+
group_by(.name) |
126+
map({
127+
name: .[0].name,
128+
count: length,
129+
issues: map("#\(.number)") | join(", ")
130+
}) |
131+
sort_by(-.count) |
132+
if length > 0 then
133+
"| Component | Count | Issues |\n|---|---|---|\n" + (map("| \(.name) | \(.count) | \(.issues) |") | join("\n"))
134+
else
135+
empty
136+
end
137+
' > label_summary.md
138+
112139
# 5. Initialize the changelog file
113140
> changelog.md
114141
@@ -128,6 +155,14 @@ jobs:
128155
echo "" >> changelog.md
129156
fi
130157
158+
# 7.5 Conditionally add "Component Summary" Table
159+
if [ -s label_summary.md ]; then
160+
echo "## 📊 Component Updates" >> changelog.md
161+
echo "" >> changelog.md
162+
cat label_summary.md >> changelog.md
163+
echo "" >> changelog.md
164+
fi
165+
131166
# 8. Conditionally add "Other Changes"
132167
if [ -s other_issues.md ]; then
133168
echo "## 🛠️ Changes" >> changelog.md

0 commit comments

Comments
 (0)