Skip to content

Commit

Permalink
Tolerate wobbly MacOS notarization process.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fizzadar committed Oct 13, 2021
1 parent 0862b5e commit fcc728e
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions make/macos.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from os import path, unlink
from shutil import rmtree
from subprocess import CalledProcessError
from time import sleep

import click

from .settings import CODESIGN_KEY_NAME, NOTARIZE_PASSWORD_KEYCHAIN_NAME
from .util import print_and_check_output, print_and_run

Expand All @@ -11,6 +14,7 @@ def codesign(app_dir):
'codesign',
'--deep',
'--timestamp',
'--force',
'--options', 'runtime',
'--entitlements', 'make/entitlements.plist',
'--sign', CODESIGN_KEY_NAME,
Expand All @@ -23,18 +27,21 @@ def wait_for_notarization(notarize_request_id):
sleep(15)

while True:
notarize_status = print_and_check_output((
'xcrun',
'altool',
'--password', f'@keychain:{NOTARIZE_PASSWORD_KEYCHAIN_NAME}',
'--notarization-info', notarize_request_id,
))

if 'Status: in progress' not in notarize_status:
break
try:
notarize_status = print_and_check_output((
'xcrun',
'altool',
'--password', f'@keychain:{NOTARIZE_PASSWORD_KEYCHAIN_NAME}',
'--notarization-info', notarize_request_id,
))

if 'Status: in progress' not in notarize_status:
break
except CalledProcessError as e:
click.echo('Error running notarize info command:')
click.echo(click.style(e.output, 'red'))

sleep(15)

return 'Status: success' in notarize_status


Expand Down

0 comments on commit fcc728e

Please sign in to comment.