Skip to content

Commit d6cf82e

Browse files
committed
add entitlements file (required for pyinstaller binary notarization)
https://developer.apple.com/forums/thread/695989 pyinstaller/pyinstaller#4629
1 parent 134a2f9 commit d6cf82e

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,15 @@ jobs:
7676
run: pip install pyinstaller==5.0.1
7777

7878
- name: Build
79+
if: matrix.os != 'macos-10.15'
7980
working-directory: ${{ env.MCUBOOT_PATH }}/scripts/
8081
run: pyinstaller --onefile main.py -n ${{ env.PROJECT_NAME }}
8182

83+
- name: Build macOS
84+
if: matrix.os == 'macos-10.15'
85+
working-directory: ${{ env.MCUBOOT_PATH }}/scripts/
86+
run: pyinstaller --osx-entitlements-file ${{ env.IMGTOOL_PACKING_PATH }}/entitlements.plist --onefile main.py -n ${{ env.PROJECT_NAME }}
87+
8288
- name: Package
8389
if: matrix.os == 'windows-latest'
8490
working-directory: ${{ env.MCUBOOT_PATH }}/scripts/${{ env.DIST_DIR }}

entitlements.plist

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<!--
5+
These are required for binaries built by PyInstaller.
6+
For more info, see:
7+
https://developer.apple.com/documentation/security/hardened_runtime
8+
https://github.com/pyinstaller/pyinstaller/issues/4629
9+
-->
10+
<dict>
11+
<key>com.apple.security.cs.allow-jit</key>
12+
<true/>
13+
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
14+
<true/>
15+
<key>com.apple.security.cs.disable-library-validation</key>
16+
<true/>
17+
</dict>
18+
</plist>

gon.config.hcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ bundle_id = "cc.arduino.imgtool"
55

66
sign {
77
application_identity = "Developer ID Application: ARDUINO SA (7KT7ZWMCJT)"
8+
entitlements_file = "entitlements.plist"
89
}
910

1011
# Ask Gon for zip output to force notarization process to take place.

0 commit comments

Comments
 (0)