From d7c5addb07778fde5966ee73a8c9d353dcad416f Mon Sep 17 00:00:00 2001 From: Manoj Vivek Date: Sun, 12 Jul 2020 23:40:39 +0530 Subject: [PATCH] Create add-osx-cert.sh --- desktop-app/add-osx-cert.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 desktop-app/add-osx-cert.sh diff --git a/desktop-app/add-osx-cert.sh b/desktop-app/add-osx-cert.sh new file mode 100644 index 00000000..b062a759 --- /dev/null +++ b/desktop-app/add-osx-cert.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env sh + +KEY_CHAIN=build.keychain +CERTIFICATE_P12=certificate.p12 + +# Recreate the certificate from the secure environment variable +echo $CERTIFICATE_OSX_P12 | base64 --decode > $CERTIFICATE_P12 + +#create a keychain +security create-keychain -p travis $KEY_CHAIN + +# Make the keychain the default so identities are found +security default-keychain -s $KEY_CHAIN + +# Unlock the keychain +security unlock-keychain -p travis $KEY_CHAIN + +security import $CERTIFICATE_P12 -k $KEY_CHAIN -P $CERTIFICATE_OSX_PASSWORD -T /usr/bin/codesign; + +security set-key-partition-list -S apple-tool:,apple: -s -k travis $KEY_CHAIN + +# remove certs +rm -fr *.p12