A guided bash script that walks you through generating an Apple Distribution certificate and App Store provisioning profile for use in a GitHub Actions CI/CD pipeline.
All files are saved to a single directory. At the end, a github-secrets.txt file is generated with all the values you need to add to GitHub.
- Prompts you for your Apple Developer account email, name, bundle ID, and profile name
- Generates a private key and CSR
- Pauses and tells you exactly what to do on the Apple Developer Portal
- Waits for you to download and place the certificate and provisioning profile
- Converts the certificate to a
.p12with a securely generated password - Base64 encodes both files
- Writes a
github-secrets.txtwith all values ready to paste into GitHub
- OpenSSLL:
brew install opensslif not installed - An active Apple Developer account: $100 per year I think
- macOS: Windows sucks
git clone https://github.com/Neat-on-the-Rocks/ios-ci-setup.git
cd ios-ci-setup
./setup.shAll generated files are saved to an ios-ci-keys/ folder in your current directory.
The script generates these secrets automatically:
| Secret | Description |
|---|---|
APPLE_CERTIFICATE_BASE64 |
Base64-encoded Apple Distribution certificate (.p12) |
APPLE_CERTIFICATE_PASSWORD |
Auto-generated password for the .p12 |
APPLE_PROVISIONING_PROFILE_BASE64 |
Base64-encoded App Store provisioning profile |
APPLE_ID |
Your Apple Developer account email |
Add secrets at: github.com/YOUR_ORG/YOUR_REPO → Settings → Secrets and variables → Actions
- The
ios-ci-keys/directory contains your private key. Do not commit it to version control. - The generated
github-secrets.txtcontains sensitive values. Delete it after adding the secrets to GitHub. - If your private key is lost, revoke the certificate on the Apple Developer Portal and run this script again from scratch.