Skip to content

Commit 136dde8

Browse files
committed
fix(ci): vendor prebuilt Assets.car for the macOS adaptive icon
GitHub macOS runners ship an older Xcode whose actool can't compile the macOS 26 .icon format, so in-CI actool produced no Assets.car and the inject step failed. Compile it locally (Xcode 26) and vendor src-tauri/macos/Assets.car; the script now prefers the prebuilt file, falling back to actool only when absent. Also use local 'npx tauri' for the updater re-sign.
1 parent c7399e4 commit 136dde8

3 files changed

Lines changed: 27 additions & 19 deletions

File tree

‎scripts/finalize-macos.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fi
3939
if [[ -n "${TAURI_SIGNING_PRIVATE_KEY:-}" ]]; then
4040
TAR="$BUNDLE/macos/$NAME.app.tar.gz"
4141
tar -C "$BUNDLE/macos" -czf "$TAR" "$NAME.app"
42-
npx --yes @tauri-apps/cli signer sign "$TAR" >/dev/null
42+
npx tauri signer sign "$TAR" >/dev/null
4343
log "updater tarball repacked + re-signed: ${TAR##*/}"
4444
else
4545
log "TAURI_SIGNING_PRIVATE_KEY not set — leaving updater tarball untouched"

‎scripts/macos-adaptive-icon.sh‎

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,34 @@ if [ ! -d "$APP" ]; then
2828
echo " build it first (npm run tauri build) or pass the .app path explicitly." >&2
2929
exit 1
3030
fi
31-
if ! xcrun --find actool >/dev/null 2>&1; then
32-
echo "error: actool not found — install Xcode 26+." >&2
33-
exit 1
31+
# Prefer the prebuilt Assets.car vendored in the repo. GitHub's macOS runners
32+
# ship an older Xcode whose actool can't compile the macOS 26 .icon format, so
33+
# we compile it locally (Xcode 26+) and commit src-tauri/macos/Assets.car. Fall
34+
# back to a live actool compile only when the prebuilt file is absent.
35+
PREBUILT="$ROOT/src-tauri/macos/Assets.car"
36+
if [ -f "$PREBUILT" ]; then
37+
echo "→ using prebuilt Assets.car ($PREBUILT)"
38+
cp "$PREBUILT" "$APP/Contents/Resources/Assets.car"
39+
else
40+
if ! xcrun --find actool >/dev/null 2>&1; then
41+
echo "error: no prebuilt Assets.car and actool not found — install Xcode 26+." >&2
42+
exit 1
43+
fi
44+
echo "→ compiling $ICON_SRC with actool (needs Xcode 26+)"
45+
TMP="$(mktemp -d)"
46+
trap 'rm -rf "$TMP"' EXIT
47+
xcrun actool "$ICON_SRC" \
48+
--compile "$TMP" \
49+
--app-icon icon \
50+
--enable-on-demand-resources NO \
51+
--development-region en \
52+
--target-device mac --platform macosx \
53+
--minimum-deployment-target 11.0 \
54+
--output-partial-info-plist "$TMP/partial.plist" >/dev/null
55+
echo "→ injecting Assets.car into Resources/"
56+
cp "$TMP/Assets.car" "$APP/Contents/Resources/Assets.car"
3457
fi
3558

36-
echo "→ compiling $ICON_SRC with actool"
37-
TMP="$(mktemp -d)"
38-
trap 'rm -rf "$TMP"' EXIT
39-
xcrun actool "$ICON_SRC" \
40-
--compile "$TMP" \
41-
--app-icon icon \
42-
--enable-on-demand-resources NO \
43-
--development-region en \
44-
--target-device mac --platform macosx \
45-
--minimum-deployment-target 11.0 \
46-
--output-partial-info-plist "$TMP/partial.plist" >/dev/null
47-
48-
echo "→ injecting Assets.car into Resources/"
49-
cp "$TMP/Assets.car" "$APP/Contents/Resources/Assets.car"
50-
5159
echo "→ patching Info.plist (CFBundleIconName = icon)"
5260
PLIST="$APP/Contents/Info.plist"
5361
plutil -replace CFBundleIconName -string icon "$PLIST"

‎src-tauri/macos/Assets.car‎

2.84 MB
Binary file not shown.

0 commit comments

Comments
 (0)