macos-signing-keychain.d.mts 870 B

12345678910111213141516
  1. /** Own a temporary PKCS#12 signing identity for one macOS packaging invocation. */
  2. /**
  3. * Import and authorize the required p12 before work; delete the owned keychain after work settles.
  4. * Children receive only its path, never the p12 password. Existing login keychains are not unlocked.
  5. * Abrupt process termination requires the CI runner to clean its temporary directory.
  6. * @param environment Validated platform configuration with local CSC_LINK and CSC_KEY_PASSWORD.
  7. * @param action All signing work, settled before cleanup.
  8. * @param run Apple command executor.
  9. * @returns Resolves after work and cleanup; rejects on setup, work, or cleanup failure.
  10. */
  11. export function withMacOSSigningKeychain(
  12. environment: NodeJS.ProcessEnv,
  13. action: (environment: NodeJS.ProcessEnv) => Promise<void>,
  14. run?: (command: string, args: string[]) => void,
  15. ): Promise<void>