Skip to content

Commit 6566b5f

Browse files
authored
feat: Better changelogs (#6)
* remove build-fix.sh simplify sudoif * fix justfile * Update create-release.yml * consolidate desktop/server changelogs * control set -x in builds * quiet local builds * set -x if id == 0 * fix justfile * explicitly specify incus dependencies * add back distrobuilder * control set_x * absolute path justfile * Revert "absolute path justfile" This reverts commit b64cca8. * improve merge-changelog * fetch everything for tags * remove UCORE_MATRIX * fix variable name. * feat: make changelogs in order
1 parent a8bdd92 commit 6566b5f

File tree

2 files changed

+40
-11
lines changed

2 files changed

+40
-11
lines changed

Justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ merge-changelog:
495495
#!/usr/bin/bash
496496
set ${SET_X:+-x} -eou pipefail
497497
rm -f changelog.md
498-
cat changelog*.md > changelog.md
498+
cat changelog-stable.md changelog-bazzite.md > changelog.md
499499
last_tag=$(git tag --list {{ repo_image_name }}-* | sort -V | tail -1)
500500
date_extract="$(echo ${last_tag:-} | grep -oP '{{ repo_image_name }}-\K[0-9]+')"
501501
date_version="$(echo ${last_tag:-} | grep -oP '\.\K[0-9]+$' || true)"

changelogs.py

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
PATTERN_PKGREL = "{version}"
3333
COMMON_PAT = "### All Images\n| | Name | Previous | New |\n| --- | --- | --- | --- |{changes}\n\n"
3434
DESKTOP_PAT = "### Desktop Images\n| | Name | Previous | New |\n| --- | --- | --- | --- |{changes}\n\n"
35+
BAZZITE_PAT = "### [Bazzite Images](https://bazzite.gg)\n| | Name | Previous | New |\n| --- | --- | --- | --- |{changes}\n\n"
3536
OTHER_NAMES = {
3637
"aurora": "### [Aurora Images](https://getaurora.dev/)\n| | Name | Previous | New |\n| --- | --- | --- | --- |{changes}\n\n",
3738
"bluefin": "### [Bluefin Images](https://projectbluefin.io/)\n| | Name | Previous | New |\n| --- | --- | --- | --- |{changes}\n\n",
3839
"cosmic": "### Cosmic Images\n| | Name | Previous | New |\n| --- | --- | --- | --- |{changes}\n\n",
39-
"bazzite": "### [Bazzite Images](https://bazzite.gg)\n| | Name | Previous | New |\n| --- | --- | --- | --- |{changes}\n\n",
4040
"ucore": "### Ucore Images\n| | Name | Previous | New |\n| --- | --- | --- | --- |{changes}\n\n",
4141
"nvidia": "### Nvidia Images\n| | Name | Previous | New |\n| --- | --- | --- | --- |{changes}\n\n",
4242
}
@@ -56,6 +56,9 @@
5656
| **Kernel** | {pkgrel:kernel} |
5757
| **Mesa** | {pkgrel:mesa-dri-drivers} |
5858
| **Podman** | {pkgrel:podman} |
59+
| **Gnome** | {pkgrel:gnome-control-center-filesystem} |
60+
| **Nvidia** | {pkgrel:nvidia-driver} |
61+
| **KDE** | {pkgrel:plasma-desktop} |
5962
| **Docker** | {pkgrel:docker-ce} |
6063
| **Incus** | {pkgrel:incus} |
6164
@@ -166,6 +169,7 @@ def get_packages(manifests: dict[str, Any]):
166169

167170
def get_package_groups(target: str, prev: dict[str, Any], manifests: dict[str, Any]):
168171
common = set()
172+
bazzite = set()
169173
desktop = set()
170174
others = {k: set() for k in OTHER_NAMES.keys()}
171175

@@ -177,9 +181,11 @@ def get_package_groups(target: str, prev: dict[str, Any], manifests: dict[str, A
177181
for k in keys:
178182
pkg[k] = set(npkg.get(k, {})) | set(ppkg.get(k, {}))
179183

180-
# Find common packages
184+
# Find common packages (Ignore Bazzite)
181185
first = True
182186
for img, image, image_flavor in get_images(target):
187+
if image == "bazzite":
188+
continue
183189
if img not in pkg:
184190
continue
185191

@@ -212,6 +218,23 @@ def get_package_groups(target: str, prev: dict[str, Any], manifests: dict[str, A
212218

213219
first = False
214220

221+
# Find Bazzite packages
222+
first = True
223+
for img, image, image_flavor in get_images(target):
224+
if image != "bazzite":
225+
continue
226+
if img not in pkg:
227+
continue
228+
229+
if first:
230+
for p in pkg[img]:
231+
bazzite.add(p)
232+
else:
233+
for c in bazzite.copy():
234+
if c not in pkg[img]:
235+
bazzite.remove(c)
236+
237+
first = False
215238
# Find other packages
216239
for t, other in others.items():
217240
first = True
@@ -227,26 +250,23 @@ def get_package_groups(target: str, prev: dict[str, Any], manifests: dict[str, A
227250
continue
228251
if t == "bluefin" and image != "bluefin":
229252
continue
230-
if t == "bazzite" and image != "bazzite":
231-
continue
232253
if t == "cosmic" and image != "cosmic":
233254
continue
234255
if t == "ucore" and image != "ucore":
235256
continue
236257

237258
if first:
238259
for p in pkg[img]:
239-
if p not in common:
240-
if p not in desktop:
241-
other.add(p)
260+
if p not in [*common, *desktop, *bazzite]:
261+
other.add(p)
242262
else:
243263
for c in other.copy():
244264
if c not in pkg[img]:
245265
other.remove(c)
246266

247267
first = False
248268

249-
return sorted(common), sorted(desktop), {k: sorted(v) for k, v in others.items()}
269+
return sorted(common), sorted(bazzite), sorted(desktop), {k: sorted(v) for k, v in others.items()}
250270

251271

252272
def get_versions(manifests: dict[str, Any]):
@@ -348,7 +368,7 @@ def generate_changelog(
348368
prev_manifests,
349369
manifests,
350370
):
351-
common, desktop, others = get_package_groups(target, prev_manifests, manifests)
371+
common, bazzite, desktop, others = get_package_groups(target, prev_manifests, manifests)
352372
versions = get_versions(manifests)
353373
prev_versions = get_versions(prev_manifests)
354374

@@ -377,6 +397,11 @@ def generate_changelog(
377397
title = CHANGELOG_TITLE.format_map(defaultdict(str, tag=STRIP_PATTERN(curr_tags[0]), pretty=pretty))
378398

379399
changelog = CHANGELOG_FORMAT
400+
401+
if target == "bazzite":
402+
changelog = changelog.splitlines()
403+
del changelog[12:15]
404+
changelog = '\n'.join(changelog)
380405

381406
changelog = (
382407
changelog.replace("{handwritten}", handwritten if handwritten else HANDWRITTEN_PLACEHOLDER)
@@ -400,13 +425,17 @@ def generate_changelog(
400425
)
401426

402427
changes = ""
403-
changes += get_commits(prev_manifests, manifests, workdir)
428+
if target == "stable":
429+
changes += get_commits(prev_manifests, manifests, workdir)
404430
common = calculate_changes(common, prev_versions, versions)
431+
bazzite = calculate_changes(bazzite, prev_versions, versions)
405432
desktop = calculate_changes(desktop, prev_versions, versions)
406433
if common:
407434
changes += COMMON_PAT.format(changes=common)
408435
if desktop:
409436
changes += DESKTOP_PAT.format(changes=desktop)
437+
if bazzite:
438+
changes += BAZZITE_PAT.format(changes=bazzite)
410439
for k, v in others.items():
411440
chg = calculate_changes(v, prev_versions, versions)
412441
if chg:

0 commit comments

Comments
 (0)