read_codesign_pass 1.3 KB

123456789101112131415161718192021222324252627282930313233
  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. local codesign_ident_short=$(print "${CODESIGN_IDENT}" | /usr/bin/sed -En 's/.+\((.+)\)/\1/p')
  18. if (( ! ${+CODESIGN_IDENT_USER} )) {
  19. read_codesign_user
  20. }
  21. log_info 'Setting up password for notarization keychain...'
  22. if (( ! ${+CODESIGN_IDENT_PASS} )) {
  23. read -s CODESIGN_IDENT_PASS'?Apple Developer ID password: '
  24. }
  25. print ''
  26. log_info 'Setting up notarization keychain...'
  27. xcrun notarytool store-credentials 'OBS-Codesign-Password' --apple-id "${CODESIGN_IDENT_USER}" --team-id "${codesign_ident_short}" --password "${CODESIGN_IDENT_PASS}"