ci(release): desktop-entry icon gate; Icon Composer app icon on macOS
Linux: scripts/packaging/desktop_entry_check.sh asserts the MPRIS DesktopEntry constant against the recipes (nfpm basename + Icon=, StartupWMClass, reverse-DNS basenames) and against the built deb/rpm/ AppDir. The AppDir's desktop file now carries the reverse-DNS basename so an integrated AppImage resolves the media-widget icon too. This invariant regressed more than once; it is a gate now, not a rename. macOS: compile packaging/icons/QBZ.icon (Icon Composer, issue #712) with Xcode 26's actool into Assets.car + CFBundleIconName=QBZ; icon.icns stays as CFBundleIconFile for older macOS. The Intel leg moves to macos-26-intel so both legs carry actool. cc
This commit is contained in:
5 files changed
+138
-4
No files matched your search
@@ -191,10 +191,14 @@ jobs:
|
||||
curl -fsSL -o linuxdeploy-plugin-qt \
|
||||
"https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-${ARCH_TAG}.AppImage"
|
||||
chmod +x linuxdeploy linuxdeploy-plugin-qt
|
||||
cp packaging/linux/qbz.desktop qbz.desktop
|
||||
# The desktop file goes in under the MPRIS DesktopEntry basename
|
||||
# (com.blitzfc.qbz.desktop), so an integrated AppImage resolves the
|
||||
# media-widget icon like the deb/rpm do. Icon=qbz -> qbz.png.
|
||||
cp packaging/linux/qbz.desktop com.blitzfc.qbz.desktop
|
||||
cp packaging/icons/256x256.png qbz.png
|
||||
./linuxdeploy --appimage-extract-and-run --appdir AppDir \
|
||||
-e qbz -d qbz.desktop -i qbz.png --plugin qt
|
||||
-e qbz -d com.blitzfc.qbz.desktop -i qbz.png --plugin qt
|
||||
scripts/packaging/desktop_entry_check.sh --appdir AppDir
|
||||
# Nothing in the app uses Qt SQL / network-information plugins.
|
||||
rm -rf AppDir/usr/plugins/sqldrivers AppDir/usr/plugins/networkinformation
|
||||
echo "platforms: $(ls AppDir/usr/plugins/platforms | tr '\n' ' ')"
|
||||
|
||||
@@ -104,6 +104,12 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# The media-widget icon invariant (DesktopEntry == installed .desktop
|
||||
# basename, Icon= installed) — regressed more than once, so it is a
|
||||
# gate at the recipe level here and on the built packages below.
|
||||
- name: Gate — desktop entry / icon invariant (recipes)
|
||||
run: scripts/packaging/desktop_entry_check.sh
|
||||
|
||||
# No workflow may build the frozen Slint binary: same bin name, same
|
||||
# target dir, last build wins the file — a smoke against "the wrong
|
||||
# qbz" is silent.
|
||||
@@ -225,6 +231,16 @@ jobs:
|
||||
-t "dist/qbzd-${VERSION}-1.${RPM_ARCH}.rpm"
|
||||
ls -la dist
|
||||
|
||||
# The same invariant on the ARTIFACTS: the deb/rpm must install
|
||||
# /usr/share/applications/<DesktopEntry>.desktop and its Icon=.
|
||||
- name: Gate — desktop entry / icon invariant (packages)
|
||||
run: |
|
||||
sudo apt-get install -y --no-install-recommends rpm
|
||||
scripts/packaging/desktop_entry_check.sh \
|
||||
--deb "dist/QBZ_${VERSION}_${DEB_ARCH}.deb" \
|
||||
--rpm "dist/QBZ-${VERSION}-1.${RPM_ARCH}.rpm" \
|
||||
--appdir AppDir
|
||||
|
||||
- name: Build AppImage
|
||||
run: |
|
||||
curl -fsSL -o appimagetool \
|
||||
|
||||
@@ -104,6 +104,12 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# The media-widget icon invariant (DesktopEntry == installed .desktop
|
||||
# basename, Icon= installed) — regressed more than once, so it is a
|
||||
# gate at the recipe level here and on the built packages below.
|
||||
- name: Gate — desktop entry / icon invariant (recipes)
|
||||
run: scripts/packaging/desktop_entry_check.sh
|
||||
|
||||
# No workflow may build the frozen Slint binary: same bin name, same
|
||||
# target dir, last build wins the file — a smoke against "the wrong
|
||||
# qbz" is silent.
|
||||
@@ -225,6 +231,16 @@ jobs:
|
||||
-t "dist/qbzd-${VERSION}-1.${RPM_ARCH}.rpm"
|
||||
ls -la dist
|
||||
|
||||
# The same invariant on the ARTIFACTS: the deb/rpm must install
|
||||
# /usr/share/applications/<DesktopEntry>.desktop and its Icon=.
|
||||
- name: Gate — desktop entry / icon invariant (packages)
|
||||
run: |
|
||||
sudo apt-get install -y --no-install-recommends rpm
|
||||
scripts/packaging/desktop_entry_check.sh \
|
||||
--deb "dist/QBZ_${VERSION}_${DEB_ARCH}.deb" \
|
||||
--rpm "dist/QBZ-${VERSION}-1.${RPM_ARCH}.rpm" \
|
||||
--appdir AppDir
|
||||
|
||||
- name: Build AppImage
|
||||
run: |
|
||||
curl -fsSL -o appimagetool \
|
||||
|
||||
@@ -56,8 +56,9 @@ jobs:
|
||||
cxxflags: "-include arm_acle.h"
|
||||
- target: x86_64-apple-darwin
|
||||
# macos-latest is arm64; Intel needs an Intel runner (arm_acle.h
|
||||
# is ARM-only, so no CXXFLAGS here).
|
||||
runner: macos-15-intel
|
||||
# is ARM-only, so no CXXFLAGS here). macos-26-intel so both legs
|
||||
# carry Xcode 26's actool for the Icon Composer app icon.
|
||||
runner: macos-26-intel
|
||||
artifact: qbz-macos-x86_64
|
||||
# Historical dmg naming: intel assets ship as "x64".
|
||||
arch: x64
|
||||
@@ -165,6 +166,30 @@ jobs:
|
||||
cp "crates/target/${{ matrix.target }}/release/qbz" "$APP/Contents/MacOS/qbz"
|
||||
chmod +x "$APP/Contents/MacOS/qbz"
|
||||
cp packaging/icons/icon.icns "$APP/Contents/Resources/icon.icns"
|
||||
# The Liquid Glass app icon (packaging/icons/QBZ.icon, Icon Composer
|
||||
# source, issue #712): compiled by Xcode 26's actool into
|
||||
# Assets.car + CFBundleIconName=QBZ. macOS 26 renders the layered
|
||||
# icon; older macOS and a runner without Xcode 26 fall back to
|
||||
# icon.icns via CFBundleIconFile, which is always written.
|
||||
ICON_NAME_KEY=""
|
||||
if xcrun --find actool >/dev/null 2>&1 \
|
||||
&& [[ "$(xcodebuild -version | head -1 | grep -oE '[0-9]+' | head -1)" -ge 26 ]]; then
|
||||
xcrun actool packaging/icons/QBZ.icon \
|
||||
--compile "$APP/Contents/Resources" \
|
||||
--app-icon QBZ \
|
||||
--platform macosx --minimum-deployment-target 12.0 \
|
||||
--include-all-app-icons \
|
||||
--output-partial-info-plist icon-partial.plist \
|
||||
--errors --warnings --notices 2>&1 | tee actool.log
|
||||
test -f "$APP/Contents/Resources/Assets.car" \
|
||||
|| { echo "::error::actool produced no Assets.car"; exit 1; }
|
||||
/usr/libexec/PlistBuddy -c 'Print :CFBundleIconName' icon-partial.plist \
|
||||
|| { echo "::error::actool partial plist has no CFBundleIconName"; exit 1; }
|
||||
ICON_NAME_KEY='<key>CFBundleIconName</key><string>QBZ</string>'
|
||||
echo "app icon: Icon Composer source compiled (Assets.car)"
|
||||
else
|
||||
echo "::warning::Xcode 26 actool not available — shipping icon.icns only"
|
||||
fi
|
||||
cat > "$APP/Contents/Info.plist" <<PLIST
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
@@ -176,6 +201,7 @@ jobs:
|
||||
<key>CFBundleDisplayName</key><string>QBZ</string>
|
||||
<key>CFBundleExecutable</key><string>qbz</string>
|
||||
<key>CFBundleIconFile</key><string>icon</string>
|
||||
${ICON_NAME_KEY}
|
||||
<key>CFBundleShortVersionString</key><string>${VERSION}</string>
|
||||
<key>CFBundleVersion</key><string>${VERSION}</string>
|
||||
<key>LSMinimumSystemVersion</key><string>12.0</string>
|
||||
|
||||
Executable
+72
@@ -0,0 +1,72 @@
|
||||
#!/usr/bin/env bash
|
||||
# scripts/packaging/desktop_entry_check.sh — the MPRIS DesktopEntry / .desktop
|
||||
# / icon invariant, as a gate (qbz-nix-docs/cicd/2026-08-04-desktop-entry-icon-mismatch.md).
|
||||
#
|
||||
# GNOME Shell / Plasma resolve the media widget's application icon ONLY through
|
||||
# the MPRIS `DesktopEntry` property: they look for `<DesktopEntry>.desktop` in
|
||||
# the XDG application dirs and read its `Icon=`. If the installed basename
|
||||
# differs from the constant, or `Icon=` names an icon the same package does not
|
||||
# install, the widget shows no icon — and nothing else breaks, which is why
|
||||
# this regressed more than once. Two properties, asserted at the SOURCE
|
||||
# (recipes) and, when `--deb <file>` / `--rpm <file>` / `--appdir <dir>` are
|
||||
# given, on the ARTIFACT that ships.
|
||||
set -euo pipefail
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")/../.."
|
||||
|
||||
ENTRY=$(grep -oP 'const DESKTOP_ENTRY: &str = "\K[^"]+' crates/qbz-media-controls/src/linux.rs)
|
||||
[[ -n "$ENTRY" ]] || { echo "::error::DESKTOP_ENTRY constant not found"; exit 1; }
|
||||
echo "DesktopEntry = $ENTRY"
|
||||
fail=0
|
||||
say_fail() { echo "::error::$*"; fail=1; }
|
||||
|
||||
icon_of() { grep -m1 '^Icon=' "$1" | cut -d= -f2-; }
|
||||
|
||||
# --- source recipes -----------------------------------------------------
|
||||
# nfpm (deb/rpm): the installed basename must be the constant; Icon= must be
|
||||
# one of the hicolor names nfpm installs.
|
||||
NFPM=packaging/nfpm/nfpm.yaml
|
||||
dst=$(grep -oP 'dst: /usr/share/applications/\K[^ ]+\.desktop' "$NFPM" | head -1)
|
||||
[[ "$dst" == "$ENTRY.desktop" ]] || say_fail "nfpm installs $dst, DesktopEntry is $ENTRY"
|
||||
src=$(grep -B1 "dst: /usr/share/applications/$dst" "$NFPM" | grep -oP 'src: \K\S+')
|
||||
icon=$(icon_of "$src")
|
||||
grep -q "dst: /usr/share/icons/hicolor/[0-9x]*/apps/${icon}\.png" "$NFPM" \
|
||||
|| say_fail "nfpm: $src has Icon=$icon but installs no hicolor/*/apps/$icon.png"
|
||||
# StartupWMClass must be the constant too (window <-> launcher association).
|
||||
for f in $(git ls-files 'packaging/*.desktop' 'flatpak/*.desktop'); do
|
||||
wm=$(grep -m1 '^StartupWMClass=' "$f" | cut -d= -f2-)
|
||||
[[ "$wm" == "$ENTRY" ]] || say_fail "$f: StartupWMClass=$wm != $ENTRY"
|
||||
done
|
||||
# Recipes that ship a reverse-DNS basename must match the constant exactly.
|
||||
for f in $(git ls-files 'packaging/*.desktop' 'flatpak/*.desktop' | grep -v '/qbz\.desktop$'); do
|
||||
base=$(basename "$f" .desktop)
|
||||
[[ "$base" == "$ENTRY" ]] || say_fail "$f: basename $base != $ENTRY"
|
||||
done
|
||||
|
||||
# --- artifacts ------------------------------------------------------------
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--deb)
|
||||
list=$(dpkg-deb -c "$2" | awk '{print $6}')
|
||||
grep -qx "./usr/share/applications/$ENTRY.desktop" <<<"$list" \
|
||||
|| say_fail "$2 does not install /usr/share/applications/$ENTRY.desktop"
|
||||
grep -q "^./usr/share/icons/hicolor/256x256/apps/${icon}\.png$" <<<"$list" \
|
||||
|| say_fail "$2 does not install hicolor/256x256/apps/$icon.png"
|
||||
echo "deb OK: $2"; shift 2 ;;
|
||||
--rpm)
|
||||
list=$(rpm -qlp "$2" 2>/dev/null || true)
|
||||
grep -qx "/usr/share/applications/$ENTRY.desktop" <<<"$list" \
|
||||
|| say_fail "$2 does not install /usr/share/applications/$ENTRY.desktop"
|
||||
grep -q "^/usr/share/icons/hicolor/256x256/apps/${icon}\.png$" <<<"$list" \
|
||||
|| say_fail "$2 does not install hicolor/256x256/apps/$icon.png"
|
||||
echo "rpm OK: $2"; shift 2 ;;
|
||||
--appdir)
|
||||
d="$2"
|
||||
[[ -f "$d/$ENTRY.desktop" ]] || say_fail "$d has no $ENTRY.desktop at its root"
|
||||
aicon=$(icon_of "$d/$ENTRY.desktop")
|
||||
[[ -f "$d/$aicon.png" || -L "$d/$aicon.png" ]] || say_fail "$d: Icon=$aicon but no $aicon.png at the root"
|
||||
[[ -e "$d/.DirIcon" ]] || say_fail "$d has no .DirIcon"
|
||||
echo "AppDir OK: $d"; shift 2 ;;
|
||||
*) echo "unknown arg $1"; exit 2 ;;
|
||||
esac
|
||||
done
|
||||
(( fail == 0 )) && echo "desktop-entry check OK" || exit 1
|
||||
Reference in new issue
Block a user