From 7b9e4271f4a6b481c6de8bc35a38feb4b4bf3d69 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Tue, 6 Dec 2022 10:56:35 +0200 Subject: [PATCH] [macOS] Use notarytool instead of deprecated altool. --- build-release.sh | 9 ++++----- config.sh.in | 3 ++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build-release.sh b/build-release.sh index c2fc8dd..bd9e0e4 100755 --- a/build-release.sh +++ b/build-release.sh @@ -49,12 +49,11 @@ sign_macos() { -s ${OSX_KEY_ID} -v ${_appname} && \ zip -r ${_binname}_signed.zip ${_appname}" - _request_uuid=$(ssh "${OSX_HOST}" "xcrun altool --notarize-app --primary-bundle-id \"${OSX_BUNDLE_ID}\" --username \"${APPLE_ID}\" --password \"${APPLE_ID_PASSWORD}\" --file ${_macos_tmpdir}/${_binname}_signed.zip") - _request_uuid=$(echo ${_request_uuid} | sed -e 's/.*RequestUUID = //') - ssh "${OSX_HOST}" "while xcrun altool --notarization-info ${_request_uuid} -u \"${APPLE_ID}\" -p \"${APPLE_ID_PASSWORD}\" | grep -q Status:\ in\ progress; do echo Waiting on Apple notarization...; sleep 30s; done" - if ! ssh "${OSX_HOST}" "xcrun altool --notarization-info ${_request_uuid} -u \"${APPLE_ID}\" -p \"${APPLE_ID_PASSWORD}\" | grep -q Status:\ success"; then + _request_uuid=$(ssh "${OSX_HOST}" "xcrun notarytool submit ${_macos_tmpdir}/${_binname}_signed.zip --team-id \"${APPLE_TEAM}\" --apple-id \"${APPLE_ID}\" --password \"${APPLE_ID_PASSWORD}\" --no-progress --output-format json") + _request_uuid=$(echo ${_request_uuid} | sed -e 's/.*"id":"\([^"]*\)".*/\1/') + if ! ssh "${OSX_HOST}" "xcrun notarytool wait ${_request_uuid} --team-id \"${APPLE_TEAM}\" --apple-id \"${APPLE_ID}\" --password \"${APPLE_ID_PASSWORD}\" | grep -q status:\ Accepted"; then echo "Notarization failed." - _notarization_log=$(ssh "${OSX_HOST}" "xcrun altool --notarization-info ${_request_uuid} -u \"${APPLE_ID}\" -p \"${APPLE_ID_PASSWORD}\"") + _notarization_log=$(ssh "${OSX_HOST}" "xcrun notarytool log ${_request_uuid} --team-id \"${APPLE_TEAM}\" --apple-id \"${APPLE_ID}\" --password \"${APPLE_ID_PASSWORD}\"") echo "${_notarization_log}" ssh "${OSX_HOST}" "rm -rf ${_macos_tmpdir}" exit 1 diff --git a/config.sh.in b/config.sh.in index 3694af5..814ff3d 100644 --- a/config.sh.in +++ b/config.sh.in @@ -50,7 +50,8 @@ export OSX_HOST='' export OSX_KEY_ID='' # Bundle id for the signed app export OSX_BUNDLE_ID='' -# Username/password for Apple's signing APIs (used for atltool) +# Username/password for Apple's signing APIs (used for notarytool) +export APPLE_TEAM='' export APPLE_ID='' export APPLE_ID_PASSWORD=''