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
Type: object

Properties

workflows Record<string, object> required

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

SecureEnvironmentVariable object
name string required
filePath string required
type string required
Values: "secure_environment_variable"
group string required
source string required
InstanceType string

Build machine type to use for the build.

TriggeringEvent string

Currently supported events are push, pull_request, tag, pull_request_labeled.

BranchPattern object
pattern string | string | SecureEnvironmentVariable | string | integer | number | boolean

The pattern can also be passed with an environment variable.

Default: "*"
include boolean

If set to false, the matching branches will not be watched for triggering events.

Default: true
source boolean

The variable is ignored for events other than pull_request.

Default: true
TagPattern object
pattern string | string | SecureEnvironmentVariable | string | integer | number | boolean

The pattern can also be passed with an environment variable.

Default: "*"
include boolean

If set to false, the matching tags will not be watched for triggering events.

Default: true
Triggering object

Currently supported events are push, pull_request, tag, pull_request_labeled, pull_request_labelled.

branch_patterns BranchPattern[]

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.

minItems=1
tag_patterns TagPattern[]

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.

minItems=1
cancel_previous_builds boolean | string | string

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.

Default: false
InputType string

An enumeration.

Input object
description string required

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.

minLength=1
type

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.

Default: "string"
All of: InputType string
options string | integer | number | boolean[]

Provide a list of values as options for the choice input. Required if type is choice and prohibited otherwise.

minItems=1
default boolean | integer | number | string

Provide a default value for the input parameter. Must be specified if the input is not required and prohibited otherwise.

DistributionType string

An enumeration.

ProfileWithVariable object
profile string | string | SecureEnvironmentVariable | string required

Profile reference found in Team settings -> Code signing identities

environment_variable string

Name of the variable containing the profile path

minLength=1
CertificateWithVariable object
certificate string | string | SecureEnvironmentVariable | string required

Certificate reference found in Team settings -> Code signing identities

environment_variable string

Name of the variable containing the certificate path

minLength=1
IosSigning object
distribution_type string | DistributionType

Type of certificates and profiles to fetch from Code signing identities

bundle_identifier string | string | SecureEnvironmentVariable | string

Bundle identifier of certificates and profiles to fetch from Code signing identities

provisioning_profiles string | string | SecureEnvironmentVariable | string | ProfileWithVariable[]

Provisioning profiles to fetch from Code signing identities

minItems=1
certificates string | string | SecureEnvironmentVariable | string | CertificateWithVariable[]

Certificates to fetch from Code signing identities

minItems=1
KeystoreWithVariables object
keystore string | string | SecureEnvironmentVariable | string required

Keystore reference found in Team settings -> Code signing identities

keystore_environment_variable string

Name of the variable containing the keystore path

minLength=1
keystore_password_environment_variable string

Name of the variable containing the keystore password

minLength=1
key_alias_environment_variable string

Name of the variable containing the key alias

minLength=1
key_password_environment_variable string

Name of the variable containing the key password

minLength=1
FlutterWithFlavor object
version string | integer | number required

Define the channel name, version (e.g. v1.13.4) or 'fvm' if using Flutter Version Management.

flavor string | string | SecureEnvironmentVariable | string

The name of the flavor to use when using FVM.

Environment object
vars Record<string, string | integer | number | boolean>

Define your environment variables.

groups string[]

Define environment variable group names that have been configured in app or team settings.

ios_signing

iOS code signing identities configured under Team settings

All of: IosSigning object
android_signing KeystoreWithVariables | string | string | SecureEnvironmentVariable | string[]

Android code signing identities configured under Team settings

minItems=1
xcode string | string | SecureEnvironmentVariable | string | integer | number

Define latest, edge or version (e.g. 26.4).

Default: "latest"
ubuntu string | string | SecureEnvironmentVariable | string | integer | number

Define the Ubuntu version to use for the build.

cocoapods string | string | SecureEnvironmentVariable | string | integer | number

Define default or version (e.g. 1.9.1).

Default: "default"
node string | string | SecureEnvironmentVariable | string | integer | number

Define default, latest, current, lts, carbon (or another stream), nightly or version (e.g. 12.4.0).

npm string | string | SecureEnvironmentVariable | string | integer | number

Define default, latest, next, lts or version (e.g. 6.13.7).

ndk string | string | SecureEnvironmentVariable | string | integer | number

Define default or revision (e.g. r19c).

java string | string | SecureEnvironmentVariable | string | integer | number

Define default, or platform version (e.g. 11).

ruby string | string | SecureEnvironmentVariable | string | integer | number

Define default, or platform version (e.g. 2.5.1).

flutter string | string | SecureEnvironmentVariable | string | integer | number | FlutterWithFlavor

Define the channel name, version (e.g. v1.13.4) or 'fvm' if using Flutter Version Management.

unity string | string | SecureEnvironmentVariable | string

Define exact version (e.g. 2020.3.15f2).

Integrations object
app_store_connect string | string | SecureEnvironmentVariable | string

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.

Cache object
cache_paths string[]

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.

Changeset object
includes string | integer | number | boolean[]
excludes string | integer | number | boolean[]
When object
changeset

List of paths or path patterns to watch for changes, proceed if changes are detected.

All of: Changeset object
condition string | string | string

Check if condition evaluates to true before proceeding with building workflow or script.

ScriptOnFailure string

The only supported action is to proceed directly to publishing.

PreCloneScript object
script string required

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.

minLength=1
name string | integer | number | boolean

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.

ignore_failure boolean | string | string

If set to true, the workflow will continue to run even if the script fails.

Default: false
on_failure string | ScriptOnFailure

The only supported action is to proceed directly to publishing.

when

All conditions below should be met in order for script to continue.

All of: When object
working_directory string

Specify directory where this script will be executed. It overrides global workflow working directory.

BuildScript object
script string required

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.

minLength=1
name string | integer | number | boolean

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.

ignore_failure boolean | string | string

If set to true, the workflow will continue to run even if the script fails.

Default: false
on_failure string | ScriptOnFailure

The only supported action is to proceed directly to publishing.

when

All conditions below should be met in order for script to continue.

All of: When object
working_directory string

Specify directory where this script will be executed. It overrides global workflow working directory.

test_report string

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.

minLength=1
PublisherNotification object
success boolean | string | string

Set to false to not receive a notification when a build succeeds.

Default: true
failure boolean | string | string

Set to false to not receive a notification when a build fails.

Default: true
Email object
recipients string | string | string | SecureEnvironmentVariable[] required

Provide valid email addresses here.

minItems=1
notify

Allows to turn on or turn off email notification on build success or failure.

All of: PublisherNotification object
Slack object
channel string | string | SecureEnvironmentVariable | string required

To allow publishing to private channels, invite the Codemagic Slack app to the channels by writing @codemagic in the channel.

notify_on_build_start boolean | string | string

When you set notify_on_build_start to true, the channel will be notified when a build starts.

Default: false
notify

Allows to turn on or turn off slack notification on build success or failure.

All of: PublisherNotification object
AppStoreConnectAuth string

An enumeration.

AppStoreReleaseType string

An enumeration.

AppStoreConnect object
auth string | AppStoreConnectAuth

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.

api_key string | string | string | string | SecureEnvironmentVariable

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.

key_id string | string | string | string | SecureEnvironmentVariable

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.

issuer_id string | string | string | string | SecureEnvironmentVariable

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.

apple_id string | string | string | string | SecureEnvironmentVariable

The email address used to log in to App Store Connect. It can also be passed with an environment variable.

password string | string | string | string | SecureEnvironmentVariable

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_to_testflight boolean | string | string

Submit published build to Testflight. Requires authentication using App Store Connect API key.

Default: false
expire_build_submitted_for_review boolean | string | string

Expire previously submitted build that is in review before submitting published build to Testflight. Requires authentication using App Store Connect API key.

Default: false
beta_groups string | string | string[]

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_to_app_store boolean | string | string

Submit published build to App Store review. Requires authentication using App Store Connect API key.

Default: false
cancel_previous_submissions boolean | string | string

Cancel previous submissions before submitting application package to App Store review. Requires authentication using App Store Connect API key.

Default: false
release_type string | AppStoreReleaseType

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.

earliest_release_date string | string

Specify earliest return date for scheduled release type. Timezone aware ISO8601 timestamp, for example 2021-11-10T14:55:41+00:00.

copyright string | string | string

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.

phased_release boolean | string | string

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.

Default: false
ReleasePromotion object
track string | string | string required

The track to promote the release to. Used in conjunction with the 'track` argument.

rollout_fraction number | string | string

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.

promote_as_draft boolean | string | string

Indicates that the promoted release will be in the draft status in the target track.

Default: false
GooglePlay object
credentials string | string | SecureEnvironmentVariable | string required

The encrypted JSON key file or the encrypted contents of the JSON key file. The value can also be passed with an environment variable.

track string | string | SecureEnvironmentVariable | string required

Codemagic enables you to automatically publish your app to Google Play.

release_name string | string | SecureEnvironmentVariable | string

Not required to be unique. If not set, the name is generated from the APK's versionName.

in_app_update_priority integer | string | string

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.

rollout_fraction number | string | string

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.

changes_not_sent_for_review boolean | string | string

Indicates that the changes in this edit will not be reviewed until they are explicitly sent for review from the Google Play Console UI.

Default: false
submit_as_draft boolean | string | string

Indicates that the artifacts generated in the build will be uploaded to Google Play as a draft release.

Default: false
release_promotion

Additionally, promote the uploaded release to another track

All of: ReleasePromotion object
FirebaseAndroidArtifactType string

An enumeration.

FirebaseType object
app_id string | string | SecureEnvironmentVariable | string required

Firebase application id found in Firebase application settings.

groups string | string | string[]

Test groups that the application should be distributed to.

artifact_type string | FirebaseAndroidArtifactType

Artifact type (aab/apk) to prioritize when uploading to Firebase App Distribution, by default app bundles are prioritized.

Firebase object
firebase_token string | string | SecureEnvironmentVariable | string

Firebase access token generated using Firebase CLI; to receive the token use firebase login:ci with Firebase CLI installed.

firebase_service_account string | string | SecureEnvironmentVariable | string

The content of service account file that has "Firebase App Distribution Admin" role.

ios

Codemagic enables you to automatically publish your iOS app to Firebase App Distribution.

All of: FirebaseType object
android

Codemagic enables you to automatically publish your Android app to Firebase App Distribution.

All of: FirebaseType object
PartnerCenter object
store_id string | string | SecureEnvironmentVariable | string

Store ID set up on Microsoft Partner Center.

tenant_id string | string | SecureEnvironmentVariable | string

Directory (tenant) ID in Azure AD portal.

client_id string | string | SecureEnvironmentVariable | string

Application (client) ID in Azure AD portal.

client_secret string | string | SecureEnvironmentVariable | string

The value of the Azure AD app key.

Publishing object
email

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.

All of: Email object
slack

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.

All of: Slack object
app_store_connect

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.

All of: AppStoreConnect object
google_play

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.

All of: GooglePlay object
firebase

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.

All of: Firebase object
partner_center

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.

All of: PartnerCenter object
scripts string | BuildScript[]

Add scripts to publish to any other service.

minItems=1
tester_groups string[]

List the tester groups that will receive new versions of the application.

minItems=1
Workflow object
name string

Workflow name displayed in the Codemagic UI.

instance_type string | string | SecureEnvironmentVariable | InstanceType

Build machine type to use for the build.

max_build_duration integer | string | string

By default, Codemagic builds are set to time out after 60 minutes. You can decrease or increase the maximum build duration.

triggering

Triggering defines the events for automatic build triggering and watched branches. If no events are defined, you can start builds only manually.

All of: Triggering object
inputs Record<string, object>

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

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.

All of: Environment object
integrations

Allows using info from the integrations connected in Codemagic UI. Currently supported: app_store_connect.

All of: Integrations object
cache

Define the paths to be cached and stored on Codemagic.

All of: Cache object
when

All conditions below should be met in order for build to continue.

All of: When object
working_directory string | string | string

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.

pre_clone_scripts string | PreCloneScript[]

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.

minItems=1
scripts string | BuildScript[]

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.

minItems=1
artifacts string | integer | number | boolean[]

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.

minItems=1
publishing

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.

All of: Publishing object
labels string | string | string[]

Define label names to easily filter builds in UI. You can use environment variable as well.

Default:
[]