mirror of
https://github.com/qvacua/vimr.git
synced 2024-11-23 01:54:31 +03:00
Use the new notarytool
This commit is contained in:
parent
463e1f38a3
commit
eb763ea6d1
@ -8,21 +8,12 @@ main() {
|
||||
echo "### Notarizing"
|
||||
ditto -c -k --keepParent VimR.app VimR.app.zip
|
||||
|
||||
echo "#### Uploading"
|
||||
local -x request_uuid
|
||||
request_uuid=$(xcrun altool --notarize-app --primary-bundle-id "com.qvacua.VimR" --username "hataewon@gmail.com" --password "@keychain:dev-notar" --file VimR.app.zip | grep RequestUUID | sed -E 's/.* = (.*)/\1/')
|
||||
readonly request_uuid
|
||||
|
||||
echo "#### Uploaded"
|
||||
echo "Use 'xcrun altool --notarization-history 0 -u hataewon@gmail.com -p @keychain:dev-notar' or"
|
||||
echo "'xcrun altool --notarization-info ${request_uuid} -u hataewon@gmail.com -p @keychain:dev-notar'"
|
||||
echo "#### Notarizing"
|
||||
xcrun notarytool submit VimR.app.zip \
|
||||
--keychain-profile "apple-dev-notar" \
|
||||
--wait
|
||||
popd >/dev/null
|
||||
|
||||
pushd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null
|
||||
echo "#### Waiting for notarization ${request_uuid} to finish"
|
||||
./bin/wait_for_notarization.py
|
||||
popd </dev/null
|
||||
|
||||
pushd "${vimr_app_path}/.." >/dev/null
|
||||
xcrun stapler staple VimR.app
|
||||
echo "### Notarization finished"
|
||||
|
@ -1,46 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from waiting import wait, TimeoutExpired
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
|
||||
def check_status(request_uuid: str) -> bool:
|
||||
proc = subprocess.run(
|
||||
f"xcrun altool --notarization-info {request_uuid} -u hataewon@gmail.com -p @keychain:dev-notar".split(),
|
||||
capture_output=True
|
||||
)
|
||||
lines = proc.stdout.decode("utf-8").split("\n")
|
||||
|
||||
success = [line for line in lines if "Status: success" in line]
|
||||
inprog = [line for line in lines if "Status: in progress" in line]
|
||||
invalid = [line for line in lines if "Status: invalid" in line]
|
||||
|
||||
if invalid:
|
||||
print("### ERROR: notarization unsuccessful!")
|
||||
exit(1)
|
||||
|
||||
if success:
|
||||
print("### Notarization successful")
|
||||
return True
|
||||
|
||||
if inprog:
|
||||
print("### Notarization in progress")
|
||||
return False
|
||||
|
||||
print("### Notarization status unclear, probably in progress")
|
||||
return False
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
request_uuid = os.environ["request_uuid"]
|
||||
print(f"### Waiting for request {request_uuid}")
|
||||
|
||||
try:
|
||||
wait(lambda: check_status(request_uuid), timeout_seconds=60*60, sleep_seconds=30)
|
||||
except TimeoutExpired:
|
||||
print("### ERROR: Timeout of 1h!")
|
||||
exit(1)
|
||||
except Exception as err:
|
||||
print(f"### ERROR: err")
|
||||
exit(1)
|
Loading…
Reference in New Issue
Block a user