CI/CD (Codemagic)
I made some small errors in the example videos. Here is what I did wrong :
- In the iOS Code Signing video, when I create the provisioning profile, I should have selected App Store Connect and not Ad Hoc.
- In the Block Integration video, I should have put all the variables under the param key.
Manually distributing your app to the stores can be a tedious process. This is where Code Magic comes in. Code Magic let's you automate the process of building, testing and distributing your app to the stores.
Setup
The integration of Codemagic requires a lot of setup. You will have to create a Codemagic account, link it to your apple and google developer accounts, add your github repo to Codemagic, generate some signing files, and more.
In this guide we'll guide you through the process of setting up Codemagic for your project.
Block Integration
Since sensitive files such as firebase_options.dart
, google-services.json
, and others are not stored directly in the GitHub repository, it is essential to provide them to Codemagic in a secure way.
We achieve this by using environment variables, which contain base64-encoded versions of these files. These encoded variables can then be accessed within the codemagic.yaml
configuration.
It's now time to add th Codemagic block to your project. To do so you'll have to gather some information into a codika_codemagic.json file.
codika codemagic-setup
codemagic_app_id : your_codemagic_app_id
google_service_account_cred_path: google-services.json
android_signing_key_codemagic_name : Android Keystore (YourTeam)
app_store_connect_key_codemagic_name : App Store Connect API Key (YourTeam)
codemagic_certificate_name : YourTeam (Distribution)
codemagic_provisioning_profile_name : YourApp (Distribution)
app_id_ios : 123456
ios_copyright : © All rights reserved
email_address : example@email.com