From 52eb568cea67185415426ea8df6cffccdd934165 Mon Sep 17 00:00:00 2001 From: sowle Date: Thu, 29 Jul 2021 02:11:08 +0300 Subject: [PATCH] macos build script fixes merged from develop --- utils/build_script_mac_osx.sh | 121 ++++++++++++++++++---------------- utils/macosx_dmg_builder.sh | 1 + 2 files changed, 64 insertions(+), 58 deletions(-) diff --git a/utils/build_script_mac_osx.sh b/utils/build_script_mac_osx.sh index 832e9b90..bb70d5fc 100755 --- a/utils/build_script_mac_osx.sh +++ b/utils/build_script_mac_osx.sh @@ -22,8 +22,11 @@ if [ "$testnet" == true ]; then ARCHIVE_NAME_PREFIX=${ARCHIVE_NAME_PREFIX}testnet- fi -# cd "$ZANO_BUILD_DIR/release/src" -# if false; then +######### DEBUG ########## +#cd "$ZANO_BUILD_DIR/release/src" +#rm *.dmg +#if false; then +##### end of DEBUG ###### rm -rf $ZANO_BUILD_DIR; mkdir -p "$ZANO_BUILD_DIR/release"; cd "$ZANO_BUILD_DIR/release" @@ -104,44 +107,13 @@ if [ $? -ne 0 ]; then exit 1 fi -#fi - codesign -s "Developer ID Application: Zano Limited" --timestamp --options runtime -f --entitlements ../../../utils/macos_entitlements.plist --deep ./Zano.app -#codesign -s "Zano" --deep -vv -f Zano.app if [ $? -ne 0 ]; then echo "Failed to sign Zano.app" exit 1 fi -rm -f Zano.zip - -# creating archive for notarizing -echo "Creating archive for notarizing" -/usr/bin/ditto -c -k --keepParent ./Zano.app ./Zano.zip - -#fi - -# notarization -echo "Notarizing..." -tmpfile="tmptmptmp" -xcrun altool --notarize-app --primary-bundle-id "org.zano.desktop" -u "andrey@zano.org" -p "@keychain:Developer-altool" --file ./Zano.zip > $tmpfile 2>&1 -NOTARIZE_RES=$? -NOTARIZE_OUTPUT=$( cat $tmpfile ) -rm $tmpfile -echo "NOTARIZE_OUTPUT=$NOTARIZE_OUTPUT" -if [ $NOTARIZE_RES -ne 0 ]; then - echo "Notarization failed" - exit 1 -fi - -GUID=$(echo "$NOTARIZE_OUTPUT" | egrep -Ewo '[[:xdigit:]]{8}(-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}') -if [ ${#GUID} -ne 36 ]; then - echo "Couldn't get correct GUID from the response, got only \"$GUID\"" - exit 1 -fi - - read version_str <<< $(DYLD_LIBRARY_PATH=$ZANO_BOOST_LIBS_PATH ./connectivity_tool --version | awk '/^Zano/ { print $2 }') version_str=${version_str} echo $version_str @@ -160,6 +132,8 @@ if [ $? -ne 0 ]; then exit 1 fi +#fi + package_filename=${ARCHIVE_NAME_PREFIX}${version_str}.dmg source ../../../utils/macosx_dmg_builder.sh @@ -169,35 +143,11 @@ if [ $? -ne 0 ]; then exit 1 fi - -success=0 - -# check notarization status -for i in {1..10}; do - xcrun altool --notarization-info $GUID -u "andrey@zano.org" -p "@keychain:Developer-altool" > $tmpfile 2>&1 - NOTARIZE_OUTPUT=$( cat $tmpfile ) - rm $tmpfile - NOTARIZATION_LOG_URL=$(echo "$NOTARIZE_OUTPUT" | sed -n "s/.*LogFileURL\: \([[:graph:]]*\).*/\1/p") - if [ $(#NOTARIZATION_LOG_URL) -ge 30 ]; then - success=1 - curl -L $NOTARIZATION_LOG_URL - break - fi - sleep 60 -done - -cd ../../.. - -if [ $success -ne 1 ]; then - echo "Build notarizaton failed" - exit 1 -fi - echo "Build success" echo "############### Uploading... ################" -package_filepath=$ZANO_BUILD_DIR/release/src/$package_filename +package_filepath=$package_filename scp $package_filepath zano_build_server:/var/www/html/builds/ if [ $? -ne 0 ]; then @@ -215,3 +165,58 @@ sha256: $checksum" echo "$mail_msg" echo "$mail_msg" | mail -s "Zano macOS-x64 ${build_prefix_label}${testnet_label}build $version_str" ${emails} + + +###################### +# notarization +###################### + +cd package_folder + +echo "Notarizing..." + +# creating archive for notarizing +echo "Creating archive for notarizing" +rm -f Zano.zip +/usr/bin/ditto -c -k --keepParent ./Zano.app ./Zano.zip + +tmpfile="tmptmptmp" +xcrun altool --notarize-app --primary-bundle-id "org.zano.desktop" -u "andrey@zano.org" -p "@keychain:Developer-altool" --file ./Zano.zip > $tmpfile 2>&1 +NOTARIZE_RES=$? +NOTARIZE_OUTPUT=$( cat $tmpfile ) +rm $tmpfile +echo "NOTARIZE_OUTPUT=$NOTARIZE_OUTPUT" +if [ $NOTARIZE_RES -ne 0 ]; then + echo "Notarization failed" + exit 1 +fi + +GUID=$(echo "$NOTARIZE_OUTPUT" | egrep -Ewo '[[:xdigit:]]{8}(-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}') +if [ ${#GUID} -ne 36 ]; then + echo "Couldn't get correct GUID from the response, got only \"$GUID\"" + exit 1 +fi + + +success=0 + +# check notarization status +for i in {1..10}; do + xcrun altool --notarization-info $GUID -u "andrey@zano.org" -p "@keychain:Developer-altool" > $tmpfile 2>&1 + NOTARIZE_OUTPUT=$( cat $tmpfile ) + rm $tmpfile + NOTARIZATION_LOG_URL=$(echo "$NOTARIZE_OUTPUT" | sed -n "s/.*LogFileURL\: \([[:graph:]]*\).*/\1/p") + if [ ${#NOTARIZATION_LOG_URL} -ge 30 ]; then + success=1 + curl -L $NOTARIZATION_LOG_URL + break + fi + sleep 60 +done + +if [ $success -ne 1 ]; then + echo "Build notarization failed" + exit 1 +fi + +echo "Notarization done" diff --git a/utils/macosx_dmg_builder.sh b/utils/macosx_dmg_builder.sh index 7defc9cc..4fb211f8 100644 --- a/utils/macosx_dmg_builder.sh +++ b/utils/macosx_dmg_builder.sh @@ -19,6 +19,7 @@ function build_fancy_dmg() # $1 - path to package folder, $2 - dmg output filena --icon Zano.app 112 115 \ --hide-extension Zano.app \ --app-drop-link 365 115 \ + --no-internet-enable \ $2 \ $1