Skip to content

Instantly share code, notes, and snippets.

@Antoniozinchenko
Last active April 7, 2023 07:16
Show Gist options
  • Save Antoniozinchenko/b87e177e4162bdf4015a075d4f75613a to your computer and use it in GitHub Desktop.
Save Antoniozinchenko/b87e177e4162bdf4015a075d4f75613a to your computer and use it in GitHub Desktop.
Composite Github action for ios signing

Getting started

This action will help you to setup ios signing files. Just copy this file inside .github/actions/certificates/action.yml

How to use

inside your workflow, just add step:

  steps:
     ...
     
      - name: Generate ios certificates
        uses: ./.github/actions/certificates
        with:
          P12_BASE64:  ${{ secrets.P12_BASE64 }}
          P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
          PROVISIONING_PROFILE_PROD_BASE64: ${{ secrets.PROVISIONING_PROFILE_PROD_BASE64 }}
          PROVISIONING_PROFILE_DEV_BASE64: ${{ secrets.PROVISIONING_PROFILE_DEV_BASE64 }}
          
     ...
name: Setup IOS certificates
description: Generate ios certificates and provisioning profiles based on p12 and base64 files
inputs:
P12_BASE64:
description: certificates archive
required: true
P12_PASSWORD:
description: certificates archive password
required: true
PROVISIONING_PROFILE_PROD_BASE64:
description: production provision profile
required: true
PROVISIONING_PROFILE_DEV_BASE64:
description: development provisioning profile
required: true
runs:
using: composite
steps:
- name: Install Apple Certificate
uses: apple-actions/import-codesign-certs@v2
with:
p12-file-base64: ${{ inputs.P12_BASE64 }}
p12-password: ${{ inputs.P12_PASSWORD }}
- name: Make dir for Provisioning Profiles
run: mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
shell: bash
- name: Install the provisioning profile PROD
env:
PROVISIONING_CERTIFICATE_BASE64: ${{ inputs.PROVISIONING_PROFILE_PROD_BASE64 }}
run: |
PP_PATH=$RUNNER_TEMP/build_pp_prod.mobileprovision
echo -n "$PROVISIONING_CERTIFICATE_BASE64" | base64 --decode --output $PP_PATH
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
shell: bash
- name: Install the provisioning profile DEV
env:
PROVISIONING_CERTIFICATE_BASE64: ${{ inputs.PROVISIONING_PROFILE_DEV_BASE64 }}
run: |
PP_PATH=$RUNNER_TEMP/build_pp_dev.mobileprovision
echo -n "$PROVISIONING_CERTIFICATE_BASE64" | base64 --decode --output $PP_PATH
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
shell: bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment