Skip to content

Commit

Permalink
chore: use unique name for temp macos keychain
Browse files Browse the repository at this point in the history
  • Loading branch information
id committed Dec 22, 2022
1 parent 780d715 commit a1af574
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scripts/macos-sign-binaries.sh
Expand Up @@ -21,10 +21,16 @@ REL_DIR="${1}"
PKSC12_FILE="$HOME/developer-id-application.p12"
base64 --decode > "${PKSC12_FILE}" <<<"${APPLE_DEVELOPER_ID_BUNDLE}"

KEYCHAIN='emqx.keychain-db'
KEYCHAIN="emqx-$(date +%s).keychain-db"
KEYCHAIN_PASSWORD="$(openssl rand -base64 32)"

security delete-keychain "${KEYCHAIN}" 2>/dev/null || true
trap cleanup EXIT

function cleanup {
set +e
security delete-keychain "${KEYCHAIN}" 2>/dev/null
}

security create-keychain -p "${KEYCHAIN_PASSWORD}" "${KEYCHAIN}"
security set-keychain-settings -lut 21600 "${KEYCHAIN}"
security unlock-keychain -p "${KEYCHAIN_PASSWORD}" "${KEYCHAIN}"
Expand Down Expand Up @@ -69,3 +75,5 @@ for f in \
; do
find "${REL_DIR}"/lib/ -name "$f" -exec codesign -s "${APPLE_DEVELOPER_IDENTITY}" -f --verbose=4 --timestamp --options=runtime {} \;
done

cleanup

0 comments on commit a1af574

Please sign in to comment.