-
Notifications
You must be signed in to change notification settings - Fork 96
/
Copy pathnotarize
executable file
·52 lines (42 loc) · 1.28 KB
/
notarize
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env python3
# This file is automatically generated by fs-package
import os
import sys
sys.path.insert(0, ".")
from fsbuild import (
checkNotarizationResult,
getBundlePath,
getPackageInformation,
isMacOS,
notarizeApp,
run,
shell,
)
def notarizeForMacOS():
bundleId = getPackageInformation().bundleId
bundlePath = getBundlePath()
bundleName = os.path.basename(bundlePath)
bundleParentDir = os.path.dirname(bundlePath)
shell("rm -f fsbuild/_build/notarize.zip")
zip = "../../../notarize.zip"
shell(
f'cd {bundleParentDir} && ditto -c -k --keepParent "{bundleName}" "{zip}"'
)
requestUuid = notarizeApp("fsbuild/_build/notarize.zip", bundleId)
checkNotarizationResult(requestUuid)
if bundlePath.endswith(".framework"):
print(
"Does not seem to be possible to staple tickets to frameworks? (error 73)"
)
print("Exiting...")
sys.exit(0)
run(["xcrun", "stapler", "staple", bundlePath])
def main():
if getPackageInformation().type == "fs-data-plugin":
print("Not notarizing data plugin")
elif isMacOS():
notarizeForMacOS()
else:
print("Skipping sign step (no signatures for this platform)")
if __name__ == "__main__":
main()