| 45 | |
| 46 | |
| 47 | def build(signing_key=None): |
| 48 | input('Did you remember to increment version.py? ' + str(version)) |
| 49 | app_name = 'Open\\ Interface' |
| 50 | |
| 51 | compile(signing_key) |
| 52 | |
| 53 | macos = platform.system() == 'Darwin' |
| 54 | if macos and signing_key: |
| 55 | # Codesign |
| 56 | os.system( |
| 57 | f'codesign --deep --force --verbose --sign "{signing_key}" dist/{app_name}.app --options runtime') |
| 58 | |
| 59 | zip_name = zip() |
| 60 | |
| 61 | if macos and signing_key: |
| 62 | keychain_profile = signing_key.split('(')[0].strip() |
| 63 | |
| 64 | # Notarize |
| 65 | os.system(f'xcrun notarytool submit --wait --keychain-profile "{keychain_profile}" --verbose dist/{zip_name}') |
| 66 | input(f'Check whether notarization was successful using \n\t xcrun notarytool history --keychain-profile {keychain_profile}.\nYou can check debug logs using \n\t xcrun notarytool log --keychain-profile "{keychain_profile}" <run-id>') |
| 67 | |
| 68 | # Staple |
| 69 | os.system(f'xcrun stapler staple dist/{app_name}.app') |
| 70 | |
| 71 | # Zip the signed, stapled file |
| 72 | zip_name = zip() |
| 73 | |
| 74 | |
| 75 | def compile(signing_key=None): |