read_codesign_pass 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. ##############################################################################
  2. # Apple Developer credentials necessary:
  3. #
  4. # + Signing for distribution and notarization require an active Apple
  5. # Developer membership
  6. # + An Apple Development identity is needed for code signing
  7. # (i.e. 'Apple Development: YOUR APPLE ID (PROVIDER)')
  8. # + Your Apple developer ID is needed for notarization
  9. # + An app-specific password is necessary for notarization from CLI
  10. # + This password will be stored in your macOS keychain under the identifier
  11. # 'OBS-Codesign-Password'with access Apple's 'altool' only.
  12. ##############################################################################
  13. autoload -Uz read_codesign read_codesign_user log_info
  14. if (( ! ${+CODESIGN_IDENT} )) {
  15. read_codesign
  16. }
  17. if (( ! ${+CODESIGN_IDENT_USER} )) {
  18. read_codesign_user
  19. }
  20. log_info 'Setting up password for notarization keychain...'
  21. if (( ! ${+CODESIGN_IDENT_PASS} )) {
  22. read -s CODESIGN_IDENT_PASS'?Apple Developer ID password: '
  23. }
  24. log_info 'Setting up notarization keychain...'
  25. xcrun altool --store-password-in-keychain-item 'OBS-Codesign-Password' -u "${CODESIGN_IDENT_USER}" -p "${CODESIGN_IDENT_PASS}"
  26. typeset -g CODESIGN_IDENT_SHORT=$(print "${CODESIGN_IDENT}" | /usr/bin/sed -En 's/.+\((.+)\)/\1/p')