@@ -136,7 +136,9 @@ jobs:
136136 # Main executable must be signed last after all its dependencies
137137 find dist/cycode-cli -type f ! -name "cycode-cli" | while read -r file; do
138138 if file -b "$file" | grep -q "Mach-O"; then
139- codesign --force --sign "$APPLE_CERT_NAME" --timestamp --options runtime "$file"
139+ # override identifier to avoid framework-style identifiers (e.g. org.python.python)
140+ # that cause --strict verification to expect a missing Info.plist
141+ codesign --force --sign "$APPLE_CERT_NAME" --identifier "com.cycode.$(basename "$file")" --timestamp --options runtime "$file"
140142 fi
141143 done
142144
@@ -176,15 +178,39 @@ jobs:
176178
177179 # we can't staple the app because it's executable
178180
179- - name : Test macOS signed executable
181+ - name : Verify macOS code signatures
180182 if : runner.os == 'macOS'
181183 run : |
182- file -b $PATH_TO_CYCODE_CLI_EXECUTABLE
183- time $PATH_TO_CYCODE_CLI_EXECUTABLE version
184+ # verify all Mach-O binaries in the output are properly signed
185+ FAILED=false
186+ while IFS= read -r file; do
187+ if file -b "$file" | grep -q "Mach-O"; then
188+ if ! codesign --verify --strict "$file" 2>&1; then
189+ echo "INVALID signature: $file"
190+ codesign -dv "$file" 2>&1 || true
191+ FAILED=true
192+ fi
193+ fi
194+ done < <(find dist/cycode-cli -type f)
195+
196+ if [ "$FAILED" = true ]; then
197+ echo "Found binaries with invalid signatures!"
198+ exit 1
199+ fi
184200
185- # verify signature
201+ # verify main executable signature in detail
186202 codesign -dv --verbose=4 $PATH_TO_CYCODE_CLI_EXECUTABLE
187203
204+ - name : Test macOS signed executable (with quarantine)
205+ if : runner.os == 'macOS'
206+ run : |
207+ # simulate downloading from the internet by adding quarantine attribute
208+ # this triggers the same Gatekeeper/dlopen checks end users experience
209+ find dist/cycode-cli -type f -exec xattr -w com.apple.quarantine "0081;$(printf '%x' $(date +%s));CI;$(uuidgen)" {} \;
210+
211+ file -b $PATH_TO_CYCODE_CLI_EXECUTABLE
212+ time $PATH_TO_CYCODE_CLI_EXECUTABLE version
213+
188214 - name : Import cert for Windows and setup envs
189215 if : runner.os == 'Windows'
190216 env :
0 commit comments