codemagic
Codemagic CI/CD file configuration
| Type | object |
|---|---|
| File match |
codemagic.yaml
codemagic.yml
|
| Schema URL | https://catalog.lintel.tools/schemas/schemastore/codemagic/latest.json |
| Source | https://codemagic.io/codemagic-schema.json |
Validate with Lintel
npx @lintel/lintel check
Properties
You can use codemagic.yaml to define several workflows for building a project. Each workflow describes the entire build pipeline from triggers to publishing. For example, you may want to have separate workflows for developing, testing and publishing the app.
Definitions
Build machine type to use for the build.
Currently supported events are push, pull_request, tag, pull_request_labeled.
The pattern can also be passed with an environment variable.
If set to false, the matching branches will not be watched for triggering events.
The variable is ignored for events other than pull_request.
The pattern can also be passed with an environment variable.
If set to false, the matching tags will not be watched for triggering events.
Currently supported events are push, pull_request, tag, pull_request_labeled, pull_request_labelled.
A branch pattern can match the name of a particular branch, or you can use wildcard symbols to create a pattern that matches several branches. Note that for pull request builds you have to specify whether the watched branch is the source or the target of the pull request.
A tag pattern can match the name of a particular tag, or you can use wildcard symbols to create a pattern that matches several tags.
To avoid running builds on outdated commits, set cancel_previous_builds to true to automatically cancel all ongoing and queued builds triggered by webhooks on push or pull request commit when a more recent build has been triggered for the same branch.
An enumeration.
A description for this input parameter. Description is displayed in Codemagic when manually starting a build for this workflow and user is prompted to provide values for the inputs.
Defines the data type of the input parameter. This must be one of: boolean, choice, number or string. By default, string is assumed. Input values for the choice type are resolved to strings and must be defined in the options field. Values for inputs with types boolean and number are persisted as booleans and integers or floating point numbers respectively, instead of converting them to strings as long as they are not used directly in string interpolations.
Provide a list of values as options for the choice input. Required if type is choice and prohibited otherwise.
Provide a default value for the input parameter. Must be specified if the input is not required and prohibited otherwise.
An enumeration.
Profile reference found in Team settings -> Code signing identities
Name of the variable containing the profile path
Certificate reference found in Team settings -> Code signing identities
Name of the variable containing the certificate path
Type of certificates and profiles to fetch from Code signing identities
Bundle identifier of certificates and profiles to fetch from Code signing identities
Provisioning profiles to fetch from Code signing identities
Certificates to fetch from Code signing identities
Keystore reference found in Team settings -> Code signing identities
Name of the variable containing the keystore path
Name of the variable containing the keystore password
Name of the variable containing the key alias
Name of the variable containing the key password
Define the channel name, version (e.g. v1.13.4) or 'fvm' if using Flutter Version Management.
The name of the flavor to use when using FVM.
Define your environment variables.
Define environment variable group names that have been configured in app or team settings.
Android code signing identities configured under Team settings
Define latest, edge or version (e.g. 26.4).
Define the Ubuntu version to use for the build.
Define default or version (e.g. 1.9.1).
Define default, latest, current, lts, carbon (or another stream), nightly or version (e.g. 12.4.0).
Define default, latest, next, lts or version (e.g. 6.13.7).
Define default or revision (e.g. r19c).
Define default, or platform version (e.g. 11).
Define default, or platform version (e.g. 2.5.1).
Define the channel name, version (e.g. v1.13.4) or 'fvm' if using Flutter Version Management.
Define exact version (e.g. 2020.3.15f2).
Specify the name of the App Store Connect API key to be used from team or personal integrations to authenticate actions for code signing and publishing.
For example, you may consider caching the following paths: "$FLUTTER_ROOT/.pub-cache" for Dart cache, "$HOME/.gradle/caches" for gradle cache, "$HOME/Library/Caches/CocoaPods" for CocoaPods cache.
List of paths or path patterns to watch for changes, proceed if changes are detected.
Check if condition evaluates to true before proceeding with building workflow or script.
The only supported action is to proceed directly to publishing.
By default the script will be run in the Bash shell. You can run the script in other languages by defining a shebang line in the beginning.
A descriptive script name can be provided to be shown in the UI. If not passed, the first line of your script will be shown in the UI for the script block.
If set to true, the workflow will continue to run even if the script fails.
The only supported action is to proceed directly to publishing.
Specify directory where this script will be executed. It overrides global workflow working directory.
By default the script will be run in the Bash shell. You can run the script in other languages by defining a shebang line in the beginning.
A descriptive script name can be provided to be shown in the UI. If not passed, the first line of your script will be shown in the UI for the script block.
If set to true, the workflow will continue to run even if the script fails.
The only supported action is to proceed directly to publishing.
Specify directory where this script will be executed. It overrides global workflow working directory.
You can display test results visually in the build overview. The value can be an absolute path, or a path relative to $CM_BUILD_DIR (in this case the patterns will be searched recursively). Supported test report formats are Junit XML and .JSON for Flutter's --machine report.
Set to false to not receive a notification when a build succeeds.
Set to false to not receive a notification when a build fails.
Provide valid email addresses here.
Allows to turn on or turn off email notification on build success or failure.
To allow publishing to private channels, invite the Codemagic Slack app to the channels by writing @codemagic in the channel.
When you set notify_on_build_start to true, the channel will be notified when a build starts.
Allows to turn on or turn off slack notification on build success or failure.
An enumeration.
An enumeration.
Accepted value: integration. When defined, the API key info inherited from integrations is used for authenticating with App Store Connect. If you omit this key-value pair, you must define API key, key identifier and issuer identifier explicitly.
App Store Connect API key in .p8 format that is used for authenticating application packages validation and upload to App Store Connect. It is required for TestFlight submission.
App Store Connect API key identifier that is used for authenticating application packages validation and upload to App Store Connect. It is required for TestFlight submission.
App Store Connect API key issuer identifier that is used for authenticating application packages validation and upload to App Store Connect. It is required for TestFlight submission.
The email address used to log in to App Store Connect. It can also be passed with an environment variable.
App-specific passwords allow you to sign in to your account securely when you use third-party apps with your Apple ID. e.g. ujlw-ypqu-dgzw-vyog. The plain or encrypted password can also be passed with en environment variable.
Submit published build to Testflight. Requires authentication using App Store Connect API key.
Expire previously submitted build that is in review before submitting published build to Testflight. Requires authentication using App Store Connect API key.
Published build will be made available to the specified Beta groups in App Store Connect. TestFlight submission is required in order to release builds to the groups of beta testers.
Submit published build to App Store review. Requires authentication using App Store Connect API key.
Cancel previous submissions before submitting application package to App Store review. Requires authentication using App Store Connect API key.
Choose when to release the app. You can either manually release the app at a later date on the App Store Connect website, or the app version can be automatically released right after it has been approved by App Review.
Specify earliest return date for scheduled release type. Timezone aware ISO8601 timestamp, for example 2021-11-10T14:55:41+00:00.
The name of the person or entity that owns the exclusive rights to your app, preceded by the year the rights were obtained (for example, "2008 Acme Inc."). Do not provide a URL.
Whether or not to release an App Store version update in phases. With this option turned on, your version update will be released over a 7-day period to a percentage of your users (selected at random by their Apple ID) with automatic updates turned on. Learn more from https://developer.apple.com/help/app-store-connect/update-your-app/release-a-version-update-in-phases. If not specified, then the default phased release configuration for the App Store version is reused.
The track to promote the release to. Used in conjunction with the 'track` argument.
The promoted release in the target track will be staged, allowing users to choose which fraction of the testers or users get access to the application. To release to everyone, omit the rollout_fraction field.
Indicates that the promoted release will be in the draft status in the target track.
The encrypted JSON key file or the encrypted contents of the JSON key file. The value can also be passed with an environment variable.
Codemagic enables you to automatically publish your app to Google Play.
Not required to be unique. If not set, the name is generated from the APK's versionName.
If your application supports in-app updates, set the release priority by specifying an integer in range [0, 5]. Otherwise, in_app_update_priority can be omitted.
Codemagic supports staged releases, allowing users to choose which fraction of the testers or users get access to the application. To release to everyone, omit the rollout_fraction field.
Indicates that the changes in this edit will not be reviewed until they are explicitly sent for review from the Google Play Console UI.
Indicates that the artifacts generated in the build will be uploaded to Google Play as a draft release.
Additionally, promote the uploaded release to another track
An enumeration.
Firebase application id found in Firebase application settings.
Test groups that the application should be distributed to.
Artifact type (aab/apk) to prioritize when uploading to Firebase App Distribution, by default app bundles are prioritized.
Firebase access token generated using Firebase CLI; to receive the token use firebase login:ci with Firebase CLI installed.
The content of service account file that has "Firebase App Distribution Admin" role.
Codemagic enables you to automatically publish your iOS app to Firebase App Distribution.
Codemagic enables you to automatically publish your Android app to Firebase App Distribution.
Store ID set up on Microsoft Partner Center.
Directory (tenant) ID in Azure AD portal.
Application (client) ID in Azure AD portal.
The value of the Azure AD app key.
If the build finishes successfully, release notes (if passed) and the generated artifacts will be published to the provided email address(es). If the build fails, an email with a link to build logs will be sent.
Integrate Slack publishing into your Codemagic build pipeline to get notified when a build starts and receive build artifacts or logs when the build finishes. To set up publishing to Slack, you first need to connect your Slack workspace in User integrations for personal apps and in Team integrations for team apps.
Codemagic enables you to automatically publish your iOS app to App Store Connect for beta testing with TestFlight or distributing the app to users via App Store.
Codemagic enables you to automatically publish your app to the internal, alpha, beta and production tracks on Google Play. In order to do so, you will need to set up a service account in Google Play Console and add the JSON key file to your Codemagic configuration file.
Codemagic enables you to automatically publish your app to Firebase App Distribution. In order to do so, set up an account and project on Firebase and provide Codemagic with your Firebase token, Firebase app id and test groups.
Codemagic enables you to automatically publish your app to Microsoft Store. In order to do so, set up an account and project on Microsoft Partner Center and provide Codemagic with your store id, client id, client secret and tenant id.
Add scripts to publish to any other service.
List the tester groups that will receive new versions of the application.
Workflow name displayed in the Codemagic UI.
Build machine type to use for the build.
By default, Codemagic builds are set to time out after 60 minutes. You can decrease or increase the maximum build duration.
Triggering defines the events for automatic build triggering and watched branches. If no events are defined, you can start builds only manually.
Define input properties that are passed to the workflow when starting a build. Build inputs can be specified when starting a build either manually from Codemagic user interface or by sending HTTP request to Codemagic API.
Environment contains all the environment variables and enables to specify the version of Flutter, Xcode, CocoaPods, Node, npm, ndk, Java and Ruby used for building. This is also where you can add credentials and API keys required for code signing. Make sure to encrypt the values of variables that hold sensitive data.
Allows using info from the integrations connected in Codemagic UI. Currently supported: app_store_connect.
Specify the default directory to run script commands. Each script will be executed inside the specified directory, unless the working directory is specified for the script itself.
Scripts that are executed before the repository is cloned. Using pre-clone scripts you can set up a VPN connection or perform other preliminary tasks that do not require access to application source code.
Scripts specify what kind of application is built. This is where you can specify the commands to test, build and code sign your project. You can also run shell (sh) scripts directly in your .yaml file, or run scripts in other languages by defining the language with a shebang line or by launching a script file present in your repository.
Configure the paths and names of the artifacts you would like to use in the following steps, e.g. for publishing, or have available for download on the build page. All paths are relative to the clone directory, but absolute paths are supported as well. You can also use environment variables in artifact patterns. The pattern can match several files or folders. If it picks up files or folders with the same name, the top level file or folder name will be suffixed with {number}. If one of the patterns includes another pattern, duplicate artifacts are not created. apk, aab, aar, ipa, app, proguard mapping (mapping.txt), flutter_drive.log, jar, zip, xarchive and dSYM.zip files will be available as separate items in the Artifacts section on the build page. The rest of the artifacts will be included in an archive with the following name pattern: {project-name}{version}_artifacts.zip.
The matching artifacts will be published to the services you have configured. The available integrations currently are email, Slack, Google Play and App Store Connect. It is also possible to publish elsewhere with custom publishing scripts.
Define label names to easily filter builds in UI. You can use environment variable as well.
[]