Skip to content

Commit e098ad8

Browse files
committed
Notarize macOS executable
1 parent 5c05d07 commit e098ad8

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

.github/workflows/run_script.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ jobs:
4040

4141
- name: Run Packaging Script
4242
working-directory: ${{github.workspace}}
43+
env:
44+
AC_USERNAME: ${{ secrets.AC_USERNAME }}
45+
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
4346
run: CLEAR_INTL=1 ./build.sh
4447

4548
- name: Compress Artifacts

build.sh

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,28 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
232232
mv ./hvcc/dist/pyinstaller/manylinux_2_35_x86_64/Heavy Heavy/bin/Heavy/
233233
elif [[ "$OSTYPE" == "darwin"* ]]; then
234234
mv ./hvcc/dist/pyinstaller/macosx_15_0_x86_64/Heavy Heavy/bin/Heavy/
235-
/usr/bin/codesign --force -s "Developer ID Application: Timothy Schoen (7SV7JPRR2L)" ./Heavy/bin/*
236-
/usr/bin/codesign --force -s "Developer ID Application: Timothy Schoen (7SV7JPRR2L)" ./Heavy/bin/Heavy/Heavy
235+
236+
cat > entitlements.plist << EOF
237+
<?xml version="1.0" encoding="UTF-8"?>
238+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
239+
<plist version="1.0">
240+
<dict>
241+
<key>com.apple.security.cs.disable-library-validation</key>
242+
<true/>
243+
</dict>
244+
</plist>
245+
EOF
246+
247+
find ./Heavy/bin -type f -perm +111 -exec /usr/bin/codesign --force --options runtime -s "Developer ID Application: Timothy Schoen (7SV7JPRR2L)" {} \;
248+
/usr/bin/codesign --force --options runtime --entitlements entitlements.plist -s "Developer ID Application: Timothy Schoen (7SV7JPRR2L)" ./Heavy/bin/Heavy/Heavy
249+
250+
# Submit the zipped executable for notarization
251+
# This makes sure we can at least run it with online notarization
252+
ditto -c -k --keepParent ./Heavy/bin Heavy.zip
253+
xcrun notarytool store-credentials "notary_login" --apple-id ${AC_USERNAME} --password ${AC_PASSWORD} --team-id "7SV7JPRR2L"
254+
xcrun notarytool submit Heavy.zip --keychain-profile "notary_login" --wait
255+
rm Heavy.zip
256+
rm entitlements.plist
237257
fi
238258

239259
cp VERSION ./Heavy/VERSION

0 commit comments

Comments
 (0)