Install p12 Certificate on the CI/CD's macOS executor | DevsDay.ru

IT-блоги Install p12 Certificate on the CI/CD's macOS executor

dev.to 9 мая 2024 г. Kyle Foo


Here I give an example for CircleCI, in a step prior to using the certificate, let's say for code-signing, make sure you have installed the certificate on your macOS executor every time you trigger the ci/cd workflow.

See commands below for following actions.

  1. Download Certificates.p12 from cloud store
  2. Create keychain and import cert onto it
  3. Verify installed cert that is valid
  sign-app-on-macOS:
    macos:
      xcode: 15.2.0
    resource_class: macos.m1.medium.gen1
    steps:
      - run:
          name: Download and install P12 certificate on macOS
          command: |
            aws s3 cp s3://bucket/certificates/Certificates.p12 Certificates.p12
            security create-keychain -p "password" ci.keychain
            security default-keychain -s ci.keychain
            security unlock-keychain -p "password" ci.keychain
            security import Certificates.p12 -k ci.keychain -P $CSC_KEY_PASSWORD
            security set-key-partition-list -S apple-tool:,apple: -s -k "password" ci.keychain
            security find-identity -p codesigning -v
     - run: codesign --deep blah blah ...

Note that CSC_KEY_PASSWORD environment variable is set for importing the password protected cert.

Источник: dev.to

Наш сайт является информационным посредником. Сообщить о нарушении авторских прав.

circleci codesigning