b8dbe4bc15
* spec: add tests for the autoUpdater on macOS that actually test if it works * spec: add express as dep * spec: add logic to auto-trust self-signed certificate and not run autoupdate specs on MAS * build: fix the step name for importing the codesign cert * chore: update updater spec PR as per feedback * fix: s/atomBinding/electronBinding * build: use spawn instead of exec
25 lines
1 KiB
Bash
Executable file
25 lines
1 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
KEY_CHAIN=mac-build.keychain
|
|
KEYCHAIN_PASSWORD=unsafe_keychain_pass
|
|
security create-keychain -p $KEYCHAIN_PASSWORD $KEY_CHAIN
|
|
# Make the keychain the default so identities are found
|
|
security default-keychain -s $KEY_CHAIN
|
|
# Unlock the keychain
|
|
security unlock-keychain -p $KEYCHAIN_PASSWORD $KEY_CHAIN
|
|
# Set keychain locking timeout to 3600 seconds
|
|
security set-keychain-settings -t 3600 -u $KEY_CHAIN
|
|
|
|
# Add certificates to keychain and allow codesign to access them
|
|
security import "$(dirname $0)"/signing.cer -k $KEY_CHAIN -A /usr/bin/codesign
|
|
security import "$(dirname $0)"/signing.pem -k $KEY_CHAIN -A /usr/bin/codesign
|
|
security import "$(dirname $0)"/signing.p12 -k $KEY_CHAIN -P $SPEC_KEY_PASSWORD -A /usr/bin/codesign
|
|
|
|
echo "Add keychain to keychain-list"
|
|
security list-keychains -s mac-build.keychain
|
|
|
|
echo "Setting key partition list"
|
|
security set-key-partition-list -S apple-tool:,apple: -s -k $KEYCHAIN_PASSWORD $KEY_CHAIN
|
|
|
|
echo "Trusting self-signed certificate"
|
|
sudo security trust-settings-import -d "$(dirname $0)"/trust-settings.plist
|