From 4d93418cc39ad56d80bc4456f1666f8ee694d265 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Fri, 8 Nov 2019 14:24:55 -0800 Subject: [PATCH] Add macos code signing --- src/scripts/dounifiedbuild.ps1 | 3 ++- src/scripts/mkmacdmg.sh | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/scripts/dounifiedbuild.ps1 b/src/scripts/dounifiedbuild.ps1 index c12032f..0173c1e 100644 --- a/src/scripts/dounifiedbuild.ps1 +++ b/src/scripts/dounifiedbuild.ps1 @@ -2,6 +2,7 @@ param ( [Parameter(Mandatory=$true)][string]$version, [Parameter(Mandatory=$true)][string]$prev, + [Parameter(Mandatory=$true)][string]$certificate, [Parameter(Mandatory=$true)][string]$server, [Parameter(Mandatory=$true)][string]$winserver ) @@ -27,7 +28,7 @@ Write-Host "" Write-Host "[Building on Mac]" -bash src/scripts/mkmacdmg.sh --qt_path ~/Qt/5.11.1/clang_64/ --version $version +bash src/scripts/mkmacdmg.sh --qt_path ~/Qt/5.11.1/clang_64/ --version $version --certificate "$certificate" if (! $?) { Write-Output "[Error]" exit 1; diff --git a/src/scripts/mkmacdmg.sh b/src/scripts/mkmacdmg.sh index 3592266..6dea8e6 100755 --- a/src/scripts/mkmacdmg.sh +++ b/src/scripts/mkmacdmg.sh @@ -12,8 +12,8 @@ case $key in shift # past argument shift # past value ;; - -z|--zcash_path) - ZCASH_DIR="$2" + -c|--certificate) + CERTIFICATE="$2" shift # past argument shift # past value ;; @@ -35,6 +35,11 @@ if [ -z $QT_PATH ]; then exit 1; fi +if [ -z $CERTIFICATE ]; then + echo "CERTIFICATE is not set. Please set it the name of the MacOS developer certificate to sign the binary with"; + exit 1; +fi + if [ -z $APP_VERSION ]; then echo "APP_VERSION is not set. Please set it to the current release version of the app"; exit 1; @@ -71,6 +76,7 @@ mkdir artifacts >/dev/null 2>&1 rm -f artifcats/zecwallet-lite.dmg >/dev/null 2>&1 rm -f artifacts/rw* >/dev/null 2>&1 $QT_PATH/bin/macdeployqt zecwallet-lite.app +codesign --deep --force --verify --verbose -s "$CERTIFICATE" --options runtime --timestamp Zecwallet-Lite.app/ echo "[OK]"