30
30
jobs :
31
31
build-and-test :
32
32
runs-on : ${{ matrix.runs-on }}
33
- timeout-minutes : 60
33
+ timeout-minutes : 360
34
34
strategy :
35
35
fail-fast : false
36
36
matrix :
37
37
include :
38
38
# - os: "linux"
39
39
# name: "amd64"
40
40
# runs-on: "ubuntu-20-04-cuda-12-0"
41
- # - os: "mac"
42
- # name: "amd64"
43
- # runs-on: "macos-selfhosted-12"
44
- # - os: "mac"
45
- # name: "arm64"
46
- # runs-on: "macos-silicon"
47
- - os : " windows"
41
+ - os : " mac"
48
42
name : " amd64"
49
- runs-on : " windows-cuda-12-0"
43
+ runs-on : " macos-selfhosted-12"
44
+ - os : " mac"
45
+ name : " arm64"
46
+ runs-on : " macos-silicon"
47
+ # - os: "windows"
48
+ # name: "amd64"
49
+ # runs-on: "windows-cuda-12-0"
50
50
steps :
51
51
- name : Clone
52
52
id : checkout
@@ -66,13 +66,33 @@ jobs:
66
66
with :
67
67
python-version : " 3.11"
68
68
69
+ - name : Get Cer for code signing
70
+ if : runner.os == 'macOS'
71
+ run : base64 -d <<< "$CODE_SIGN_P12_BASE64" > /tmp/codesign.p12
72
+ shell : bash
73
+ env :
74
+ CODE_SIGN_P12_BASE64 : ${{ secrets.CODE_SIGN_P12_BASE64 }}
75
+
76
+ - uses : apple-actions/import-codesign-certs@v2
77
+ continue-on-error : true
78
+ if : runner.os == 'macOS'
79
+ with :
80
+ p12-file-base64 : ${{ secrets.CODE_SIGN_P12_BASE64 }}
81
+ p12-password : ${{ secrets.CODE_SIGN_P12_PASSWORD }}
82
+
83
+ - name : Get Cer for code signing
84
+ if : runner.os == 'macOS'
85
+ run : base64 -d <<< "$NOTARIZE_P8_BASE64" > /tmp/notary-key.p8
86
+ shell : bash
87
+ env :
88
+ NOTARIZE_P8_BASE64 : ${{ secrets.NOTARIZE_P8_BASE64 }}
89
+
69
90
- name : Install dependencies Windows
70
91
if : runner.os == 'windows'
71
92
shell : pwsh
72
93
run : |
73
-
74
- python3 -m pip install --upgrade pip
75
- python3 -m pip install -r ${{env.MODEL_DIR}}/requirements.cuda.txt
94
+ python3 -m pip install --upgrade pip
95
+ python3 -m pip install -r ${{env.MODEL_DIR}}/requirements.cuda.txt
76
96
77
97
- name : Install dependencies Linux
78
98
if : runner.os == 'linux'
@@ -102,9 +122,8 @@ jobs:
102
122
echo "Python path (where.exe): $pythonPath"
103
123
$pythonFolder = Split-Path -Path "$pythonPath" -Parent
104
124
echo "PYTHON_FOLDER=$pythonFolder" >> $env:GITHUB_ENV
105
-
106
125
copy "$pythonFolder\python*.*" "$pythonFolder\Scripts\"
107
-
126
+
108
127
- name : prepare python package macos
109
128
if : runner.os == 'macOs'
110
129
run : |
@@ -128,7 +147,65 @@ jobs:
128
147
rm -rf $PYTHON_FOLDER/lib/python3.1
129
148
echo "PYTHON_FOLDER=$PYTHON_FOLDER" >> $GITHUB_ENV
130
149
echo "github end PYTHON_FOLDER: ${{env.PYTHON_FOLDER}}"
131
-
150
+
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
+
190
+ - name : Notary macOS Binary
191
+ if : runner.os == 'macOS'
192
+ run : |
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" -o -name "*.dylib" \) -exec codesign --force --entitlements="/tmp/entitlements.plist" -s "${{ secrets.DEVELOPER_ID }}" --options=runtime {} \;
198
+
199
+ curl -sSfL https://raw.githubusercontent.com/anchore/quill/main/install.sh | sudo sh -s -- -b /usr/local/bin
200
+ # Notarize the binary
201
+ quill notarize ${{env.PYTHON_FOLDER}}/bin/python
202
+ quill notarize ${{env.PYTHON_FOLDER}}/bin/python3
203
+ find ${{env.PYTHON_FOLDER}} -type f \( -name "*.so" -o -name "*.dylib" \) -exec quill notarize {} \;
204
+ env :
205
+ QUILL_NOTARY_KEY_ID : ${{ secrets.NOTARY_KEY_ID }}
206
+ QUILL_NOTARY_ISSUER : ${{ secrets.NOTARY_ISSUER }}
207
+ QUILL_NOTARY_KEY : " /tmp/notary-key.p8"
208
+
132
209
- name : Upload Artifact
133
210
# if : runner.os == 'windows' || runner.os == 'linux'
134
211
uses : actions/upload-artifact@v4
@@ -143,43 +220,8 @@ jobs:
143
220
run : |
144
221
rm ${{env.PYTHON_FOLDER}}/Scripts/python*.*
145
222
146
- codesign :
147
- runs-on : macos-latest
148
- needs : build-and-test
149
- steps :
150
- - name : checkout
151
- uses : actions/checkout@v3
152
- - uses : apple-actions/import-codesign-certs@v2
223
+ - name : Remove Keychain
153
224
continue-on-error : true
154
- with :
155
- p12-file-base64 : ${{ secrets.CODE_SIGN_P12_BASE64 }}
156
- p12-password : ${{ secrets.CODE_SIGN_P12_PASSWORD }}
157
- - name : Download Artifact
158
- uses : actions/download-artifact@v4
159
- with :
160
- name : ${{env.MODEL_NAME}}-mac-amd64
161
- path : ${{env.MODEL_NAME}}-mac-amd64
162
- - name : Download Artifact
163
- uses : actions/download-artifact@v4
164
- with :
165
- name : ${{env.MODEL_NAME}}-mac-arm64
166
- path : ${{env.MODEL_NAME}}-mac-arm64
167
-
168
- - run : |
169
- find "${{env.MODEL_NAME}}-mac-amd64" \( -type f -perm +111 \) -exec codesign --force --entitlements="./engine/templates/macos/entitlements.plist" -s "${{ secrets.DEVELOPER_ID }}" --options=runtime {} \;
170
- find "${{env.MODEL_NAME}}-mac-arm64" \( -type f -perm +111 \) -exec codesign --force --entitlements="./engine/templates/macos/entitlements.plist" -s "${{ secrets.DEVELOPER_ID }}" --options=runtime {} \;
171
-
172
- - name : Upload Artifact
173
- uses : actions/upload-artifact@v4
174
- with :
175
- name : ${{env.MODEL_NAME}}-mac-amd64-signed
176
- path : ${{env.MODEL_NAME}}-mac-amd64
177
- include-hidden-files : true
178
- compression-level : 9
179
- - name : Upload Artifact
180
- uses : actions/upload-artifact@v4
181
- with :
182
- name : ${{env.MODEL_NAME}}-mac-arm64-signed
183
- path : ${{env.MODEL_NAME}}-mac-arm64
184
- include-hidden-files : true
185
- compression-level : 9
225
+ if : always() && runner.os == 'macOS'
226
+ run : |
227
+ security delete-keychain signing_temp.keychain
0 commit comments