Skip to content

Commit

Permalink
switch to notarytool (#513)
Browse files Browse the repository at this point in the history
* switch to notaryTool

* touch version number

* Update CHANGELOG.md

* prepare for the next-next release

* add mastodon verification link
  • Loading branch information
typemytype committed Feb 20, 2023
1 parent d1d66b5 commit c898e8b
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Build app
run: |
source venv/bin/activate
python setupApp.py py2app --dmg --codesign "${{ secrets.CODESIGN_NAME }}" --notarizedeveloper "${{ secrets.NOTARIZE_DEVELOPER }}" --notarizePassword "${{ secrets.NOTARIZE_PASSWORD }}"
python setupApp.py py2app --dmg --codesign "${{ secrets.CODESIGN_NAME }}" --notarizedeveloper "${{ secrets.NOTARIZE_DEVELOPER }}" --notarizeTeamID "${{ secrets.NOTARIZE_TEAMID }} --notarizePassword "${{ secrets.NOTARIZE_PASSWORD }}"
- name: Upload Notarization Log
uses: actions/upload-artifact@v1
Expand Down
15 changes: 11 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Changelog For DrawBot

## [3.130] ...
## [3.131] ...

## [3.130] 2023-02-20

- Disable `cmd .` cancel short cut as does crash DrawBot.
- Fix bug in auto completion.
- Fix missing standard lib modules.
- Switch to notarytool for notarizing the app bundle.

## [3.129] 2022-12-21

Expand All @@ -20,11 +27,11 @@

- Fixing bug when adding glyphNames to a formattedString with fontVariation settings.
- Always set the ligature default to workaround a bug in macOS
- Improve error messages for ill-specified fonts
- Improve error messages for ill-specified fonts

## [3.127] 2021-04-29

- Allow `Path` objects in places where a path is an argument: `saveImage(pathObject)`, `image(pathObject, ...)`
- Allow `Path` objects in places where a path is an argument: `saveImage(pathObject)`, `image(pathObject, ...)`
- Add support for asyncio by lauching the app with corefoundationasyncio.
- Remove `mov` context in favor of `mp4` as `QTKit` is not supported anymore.
- Always draw a white background while rendering to `mp4`.
Expand All @@ -41,7 +48,7 @@
- Add `textBoxCharacterBounds(text, box)` returning a list of typesetted bounding boxes.
- Improve `text(..)` typesetting with multiline text and paragraph styles.
- Add `formattedString.url(url)`.
- Add `linkURL(url, box)`.
- Add `linkURL(url, box)`.
- Add option `continuous` in `Variable(.., continuous=False)`.

## [3.125] 2020-04-22
Expand Down
1 change: 1 addition & 0 deletions docs/_themes/drawBotTheme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<link rel="manifest" href="{{ pathto('_static/favicons/site.webmanifest',1) }}">
<link rel="mask-icon" href="{{ pathto('_static/favicons/safari-pinned-tab.svg" color="#5bbad5',1) }}">
<link rel="shortcut icon" href="{{ pathto('_static/favicons/favicon.ico',1) }}">
<link href="https://typo.social/@drawbot" rel="me">
<meta name="msapplication-TileColor" content="#2d89ef">
<meta name="msapplication-config" content="_static/favicons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
Expand Down
2 changes: 1 addition & 1 deletion drawBot/drawBotSettings.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "3.129"
__version__ = "3.130"
112 changes: 44 additions & 68 deletions setupApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import subprocess
import shutil
import tempfile
import json
import time
import datetime
import re
Expand Down Expand Up @@ -105,6 +106,7 @@ def getValueFromSysArgv(key, default=None, isBooleanFlag=False):

notarizeDeveloper = getValueFromSysArgv("--notarizedeveloper")
notarizePassword = getValueFromSysArgv("--notarizePassword")
notarizeTeamID = getValueFromSysArgv("--notarizeTeamID")


osxMinVersion = "10.9.0"
Expand Down Expand Up @@ -333,91 +335,65 @@ def getValueFromSysArgv(key, default=None, isBooleanFlag=False):
print("- notarizing dmg -")
notarize = [
"xcrun",
"altool",
"--notarize-app",
"-t",
"osx",
"--file",
existingDmgLocation,
"--primary-bundle-id", bundleIdentifier,
"-u", notarizeDeveloper,
"-p", notarizePassword,
"--output-format", "xml"
]

notarizeStapler = [
"xcrun",
"stapler",
"staple", existingDmgLocation
"notarytool",
"submit",
"--apple-id", notarizeDeveloper,
"--team-id", notarizeTeamID,
"--password", notarizePassword,
"--output-format", "json",
"--wait",
existingDmgLocation
]

print("notarizing app")
notarisationRequestUUID = None
notarisationRequestID = None

with tempfile.TemporaryFile(mode='w+b') as stdoutFile:
popen = subprocess.Popen(notarize, stdout=stdoutFile)
popen.wait()
stdoutFile.seek(0)
data = stdoutFile.read()
data = plistlib.loads(data)
if "notarization-upload" in data:
notarisationRequestUUID = data["notarization-upload"].get("RequestUUID")
print("notarisation Request UUID:", notarisationRequestUUID)
data = json.loads(data)
print("notarisation data:")
print("\n".join([f" {k}: {v}" for k, v, in data.items()]))

if "id" in data:
notarisationRequestID = data["id"]
print("notarisation Request ID:", notarisationRequestID)

if "product-errors" in data:
print("\n".join([e["message"] for e in data["product-errors"]]))
print("done notarizing app")

notarisationSucces = False
if notarisationRequestUUID:
if notarisationRequestID:
print("getting notarization info")
notarizeInfo = [
"xcrun",
"altool",
"--notarization-info", notarisationRequestUUID,
"-u", notarizeDeveloper,
"-p", notarizePassword,
"--output-format", "xml"
]
countDown = 16
while countDown:
with tempfile.TemporaryFile(mode='w+b') as stdoutFile:
popen = subprocess.Popen(notarizeInfo, stdout=stdoutFile)
popen.wait()
stdoutFile.seek(0)
data = stdoutFile.read()
data = plistlib.loads(data)

if "notarization-info" in data:
status = data["notarization-info"].get("Status", "").lower()
print(" notarization status:", status)
if status == "success":
notarisationSucces = True
print("notarization succes")
break
if status == "invalid":
print("notarization invalid")
break
print(" Not completed yet. Sleeping for 30 seconds")
countDown -= 1
time.sleep(30)

if "notarization-info" in data:
logURL = data["notarization-info"].get("LogFileURL")
print("get notarization log")
notarizeLogPath = os.path.join(distLocation, 'notarize_log.txt')
if logURL:
os.system(f"curl -s {logURL} > {notarizeLogPath}")
else:
# create the file
open(notarizeLogPath, 'w').close()
"notarytool",
"log",
"--apple-id", notarizeDeveloper,
"--team-id", notarizeTeamID,
"--password", notarizePassword,
notarisationRequestID,
]

with open(os.path.join(distLocation, 'notarize_log.txt'), "w+b") as stdoutFile:
popen = subprocess.Popen(notarizeInfo, stdout=stdoutFile)
popen.wait()

print("done getting notarization info")
else:
print("*" * 50)
print("notarization failed")
print("*" * 50)

if notarisationSucces:
print("stapler")
popen = subprocess.Popen(notarizeStapler)
popen.wait()
print("done stapler")
print("stapler")
notarizeStapler = [
"xcrun",
"stapler",
"staple", existingDmgLocation
]
popen = subprocess.Popen(notarizeStapler)
popen.wait()
print("done stapler")

print("- done notarizing dmg -")
print("----------------------")
Expand Down

0 comments on commit c898e8b

Please sign in to comment.