Skip to content

Commit 23a70b0

Browse files
committed
fix: handle already-signed ONNX Runtime libraries in macOS signing
The ONNX Runtime dylib files from Microsoft may already be signed, which causes code signing to fail. This commit adds logic to: 1. Check if libraries are already signed 2. Use --force flag to replace existing signatures 3. Add verbose output for debugging 4. Verify signatures with --deep --strict flags This ensures our certificate is applied even if Microsoft's signature is present, which is necessary for notarization.
1 parent 6bb042f commit 23a70b0

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -323,15 +323,33 @@ jobs:
323323
echo "=== Signing ONNX Runtime library ==="
324324
for dylib in unsigned/*.dylib; do
325325
if [ -f "$dylib" ]; then
326-
echo "Signing: $dylib"
327-
codesign --sign "$CERT_IDENTITY" \
328-
--timestamp \
329-
--options runtime \
330-
--verbose \
331-
"$dylib"
332-
codesign --verify --verbose "$dylib"
326+
echo "Processing: $dylib"
327+
328+
# Check if already signed
329+
if codesign --verify "$dylib" 2>/dev/null; then
330+
echo "Already signed by: $(codesign --display --verbose "$dylib" 2>&1 | grep 'Authority=')"
331+
echo "Re-signing with our certificate..."
332+
# Use --force to replace existing signature
333+
codesign --force --sign "$CERT_IDENTITY" \
334+
--timestamp \
335+
--options runtime \
336+
--verbose \
337+
"$dylib"
338+
else
339+
echo "Not signed, signing now..."
340+
codesign --sign "$CERT_IDENTITY" \
341+
--timestamp \
342+
--options runtime \
343+
--verbose \
344+
"$dylib"
345+
fi
346+
347+
echo "Verifying signature..."
348+
codesign --verify --deep --strict --verbose=2 "$dylib"
349+
echo "✓ Successfully signed: $dylib"
333350
fi
334351
done
352+
echo "=== All libraries signed ==="
335353
336354
- name: Create ZIP for notarization
337355
run: |

0 commit comments

Comments
 (0)