1
0
Fork 0
forked from lthn/blockchain

build: macOS build script updated

This commit is contained in:
sowle 2023-07-21 13:20:55 +02:00
parent f8d953afe2
commit 57cf32b6be
2 changed files with 58 additions and 4 deletions

View file

@ -148,13 +148,17 @@ echo "Build success"
echo "############### Uploading... ################"
package_filepath=$package_filename
package_filepath="$(pwd)/$package_filename"
scp $package_filepath zano_build_server:/var/www/html/builds/
#scp $package_filepath zano_build_server:/var/www/html/builds/
source ../../../macosx_build_uploader.sh
pushd .
upload_build $package_filepath
if [ $? -ne 0 ]; then
echo "Failed to upload to remote server"
exit 1
fi
popd
read checksum <<< $( shasum -a 256 $package_filepath | awk '/^/ { print $1 }' )
@ -165,8 +169,7 @@ sha256: $checksum"
echo "$mail_msg"
python3 ../../../utils/build_mail.py "Zano linux-x64 ${build_prefix_label}${testnet_label}build $version_str" "${emails}" "$mail_msg"
python3 ../../../utils/build_mail.py "Zano macOS-x64 ${build_prefix_label}${testnet_label}build $version_str" "${emails}" "$mail_msg"
######################
# notarization

View file

@ -0,0 +1,51 @@
set +e
curr_path=${BASH_SOURCE%/*}
function upload_build() # $1 - path to the file to be uploaded
{
if [ -z "$1" ]
then
echo "ERROR: upload_build is called with no or invalid parameters"
return 1
fi
# check if the directory contains files
#if [ -n "$(ls -A "$ZANO_BLD_UPL_DIR" 2>/dev/null)" ]
#then
# echo "ERROR: uploading folder contains files"
# return 1
#fi
cd "$ZANO_BLD_UPL_DIR" || return 2
rm -rf ./* || return 3
#popd || return 4
touch WAIT || return 5
cp $1 . || return 6
rm WAIT || return 7
counter=0
while [ ! -f DONE ]
do
if [ "$counter" -ge 150 ]
then
echo "ERROR: uploading is taking longer than expected"
touch STOP
return 8
fi
sleep 2
echo "waiting..."
counter=$((counter + 1))
done
rc=$(<DONE)
if [ "$rc" -eq 0 ]
then
echo "Upload successful."
return 0
fi
echo "Upload unsuccessfull, exit code = $rc."
return $rc
}