Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 7af1352

Browse files
committed
feat: add codesign for macos
1 parent 6525313 commit 7af1352

File tree

1 file changed

+48
-5
lines changed

1 file changed

+48
-5
lines changed

.github/workflows/python-package.yml

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
runs-on: "macos-selfhosted-12"
4444
- os: "mac"
4545
name: "arm64"
46-
runs-on: "macos-13-arm"
46+
runs-on: "macos-silicon"
4747
# - os: "windows"
4848
# name: "amd64"
4949
# runs-on: "windows-cuda-12-0"
@@ -148,13 +148,56 @@ jobs:
148148
echo "PYTHON_FOLDER=$PYTHON_FOLDER" >> $GITHUB_ENV
149149
echo "github end PYTHON_FOLDER: ${{env.PYTHON_FOLDER}}"
150150
151+
- name: create plist file
152+
if: runner.os == 'macOS'
153+
run: |
154+
cat << EOF > /tmp/entitlements.plist
155+
<?xml version="1.0" encoding="UTF-8"?>
156+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
157+
<plist version="1.0">
158+
<dict>
159+
<!-- These are required for binaries built by PyInstaller -->
160+
<key>com.apple.security.cs.allow-jit</key>
161+
<true/>
162+
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
163+
<true/>
164+
165+
<!-- Add these for additional permissions -->
166+
<key>com.apple.security.app-sandbox</key>
167+
<false/>
168+
<key>com.apple.security.network.client</key>
169+
<true/>
170+
<key>com.apple.security.network.server</key>
171+
<true/>
172+
<key>com.apple.security.device.audio-input</key>
173+
<true/>
174+
<key>com.apple.security.device.microphone</key>
175+
<true/>
176+
<key>com.apple.security.device.camera</key>
177+
<true/>
178+
<key>com.apple.security.files.user-selected.read-write</key>
179+
<true/>
180+
<key>com.apple.security.cs.disable-library-validation</key>
181+
<true/>
182+
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
183+
<true/>
184+
<key>com.apple.security.cs.allow-executable-memory</key>
185+
<true/>
186+
</dict>
187+
</plist>
188+
EOF
189+
151190
- name: Notary macOS Binary
152191
if: runner.os == 'macOS'
153192
run: |
154-
codesign --force --entitlements="./engine/templates/macos/entitlements.plist" -s "${{ secrets.DEVELOPER_ID }}" --options=runtime ${{env.PYTHON_FOLDER}}/bin/python
155-
codesign --force --entitlements="./engine/templates/macos/entitlements.plist" -s "${{ secrets.DEVELOPER_ID }}" --options=runtime ${{env.PYTHON_FOLDER}}/bin/python3
156-
curl -sSfL https://raw.githubusercontent.com/anchore/quill/main/install.sh | sh -s -- -b /usr/local/bin
157-
cd engine/cortex
193+
codesign --force --entitlements="/tmp/entitlements.plist" -s "${{ secrets.DEVELOPER_ID }}" --options=runtime ${{env.PYTHON_FOLDER}}/bin/python
194+
codesign --force --entitlements="/tmp/entitlements.plist" -s "${{ secrets.DEVELOPER_ID }}" --options=runtime ${{env.PYTHON_FOLDER}}/bin/python3
195+
# Code sign all .so files and .dylib files
196+
197+
find ${{env.PYTHON_FOLDER}} -type f \( -name "*.so" \) -exec codesign --deep --force --entitlements="/tmp/entitlements.plist" -s "${{ secrets.DEVELOPER_ID }}" {} \;
198+
find ${{env.PYTHON_FOLDER}} -type f \( -name "*.dylib" \) -exec codesign --deep --force -s "${{ secrets.DEVELOPER_ID }}" {} \;
199+
200+
curl -sSfL https://raw.githubusercontent.com/anchore/quill/main/install.sh | sudo sh -s -- -b /usr/local/bin
158201
# Notarize the binary
159202
quill notarize ${{env.PYTHON_FOLDER}}/bin/python
160203
quill notarize ${{env.PYTHON_FOLDER}}/bin/python3

0 commit comments

Comments
 (0)