mirror of
https://github.com/openai/codex.git
synced 2026-11-25 23:30:49 +00:00
Add macOS notarization probe workflow
This commit is contained in:
@@ -25,8 +25,7 @@ notarize_submission() {
|
||||
--key "$notary_key_path" \
|
||||
--key-id "$APPLE_NOTARIZATION_KEY_ID" \
|
||||
--issuer "$APPLE_NOTARIZATION_ISSUER_ID" \
|
||||
--output-format json \
|
||||
--wait)
|
||||
--output-format json)
|
||||
|
||||
local status submission_id
|
||||
status=$(printf '%s\n' "$submission_json" | jq -r '.status // "Unknown"')
|
||||
@@ -37,10 +36,39 @@ notarize_submission() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "::notice title=Notarization::$label submission ${submission_id} completed with status ${status}"
|
||||
|
||||
if [[ "$status" != "Accepted" ]]; then
|
||||
echo "Notarization failed for ${label} (submission ${submission_id}, status ${status})"
|
||||
exit 1
|
||||
echo "::notice title=Notarization::$label submission ${submission_id} started with status ${status}"
|
||||
if [[ "$status" == "Accepted" ]]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
local started_at=$SECONDS
|
||||
local timeout_seconds="${NOTARY_WAIT_TIMEOUT_SECONDS:-7200}"
|
||||
while ((SECONDS - started_at < timeout_seconds)); do
|
||||
sleep 30
|
||||
|
||||
submission_json=$(xcrun notarytool info "$submission_id" \
|
||||
--key "$notary_key_path" \
|
||||
--key-id "$APPLE_NOTARIZATION_KEY_ID" \
|
||||
--issuer "$APPLE_NOTARIZATION_ISSUER_ID" \
|
||||
--output-format json)
|
||||
status=$(printf '%s\n' "$submission_json" | jq -r '.status // "Unknown"')
|
||||
echo "::notice title=Notarization::$label submission ${submission_id} status ${status}"
|
||||
|
||||
case "$status" in
|
||||
Accepted)
|
||||
return 0
|
||||
;;
|
||||
Invalid|Rejected)
|
||||
xcrun notarytool log "$submission_id" \
|
||||
--key "$notary_key_path" \
|
||||
--key-id "$APPLE_NOTARIZATION_KEY_ID" \
|
||||
--issuer "$APPLE_NOTARIZATION_ISSUER_ID" || true
|
||||
echo "Notarization failed for ${label} (submission ${submission_id}, status ${status})"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo "Timed out waiting for notarization of ${label} (submission ${submission_id}, last status ${status})"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user