Skip to content

Commit 4e4b1be

Browse files
committed
fix: sign all bundled dylibs and exclude dotfiles from doc/
macOS's code signing monitor validates every loaded Mach-O inside a .app bundle. The CI was only signing the engine binary and launcher script, but the bundled dylibs were left with the CI's self-signed cert identity which isn't trusted on user machines. Now signs all *.dylib in the lib/ directory before signing the outer bundle. Also switches doc copy from cp -R to rsync --exclude='.*' to prevent dotfiles (.hugo_build.lock, .gitignore) from being included in the bundle seal, since these get dropped during artifact upload and invalidate the code signature.
1 parent 7e90889 commit 4e4b1be

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/macos-build.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,10 @@ jobs:
267267
process_dylib "$MOLTEN_PREFIX/lib/libMoltenVK.dylib"
268268
fi
269269
270-
cp -R ../src/doc/site/. "$APP/Contents/Resources/doc/" 2>/dev/null || true
270+
# Copy docs but exclude dotfiles (like .hugo_build.lock,
271+
# .gitignore) that get dropped during artifact upload and
272+
# break the code-signed bundle seal.
273+
rsync -a --exclude='.*' ../src/doc/site/ "$APP/Contents/Resources/doc/" 2>/dev/null || true
271274
272275
# Launcher: cd into the bundle's Resources dir, then exec
273276
# the engine. Anything the engine writes (logs, savegames,
@@ -382,7 +385,12 @@ jobs:
382385
# Verify the identity is visible.
383386
security find-identity -v "$KEYCHAIN"
384387
385-
# Sign inner binaries first, then the outer bundle.
388+
# Sign all bundled dylibs, the engine binary, the launcher,
389+
# and then the outer bundle. macOS's code signing monitor
390+
# validates every loaded Mach-O inside a .app bundle, so
391+
# every dylib must have a recognised signature.
392+
codesign --force --keychain "$KEYCHAIN" --sign "$CERT_NAME" \
393+
"$APP/Contents/Resources/lib/"*.dylib
386394
codesign --force --keychain "$KEYCHAIN" --sign "$CERT_NAME" \
387395
"$APP/Contents/Resources/bin/spring" \
388396
"$APP/Contents/MacOS/$APP_NAME"

0 commit comments

Comments
 (0)