apprelease.yaml

Optional. Without this file the runner builds with the settings of the application in the console, which is all most teams need. Add it to the root of the repository to change how the app is built. Key by key:

Structure

workflows:
  <workflow-id>:
    name: Human readable name
    max_build_duration: 60        # minutes, default 60, max 120
    instance_type: mac_m2         # mac_m2 | linux_x2
    environment: { ... }
    versioning: { ... }
    triggering: { ... }
    cache: { ... }
    scripts: [ ... ]
    artifacts: [ ... ]
    publishing: { ... }

environment

    environment:
      flutter: stable             # stable | beta | master | 3.41.2 | fvm
      xcode: latest               # latest | 26.0
      cocoapods: default
      java: 17
      groups:                     # variable groups defined in the console
        - google_play
      vars:                       # plain variables, visible in the log
        PACKAGE_NAME: "com.example.app"
      android_signing:
        - upload_keystore
      ios_signing:
        distribution_type: app_store
        bundle_identifier: com.example.app
KeyDescription
flutterChannel, version or fvm. Omit to use the runner's preinstalled version.
xcodemacOS runners only. latest or a version.
groupsReference names of Google Play service accounts under Credentials. The JSON becomes GOOGLE_PLAY_SERVICE_ACCOUNT, masked in logs.
varsInline variables. Never put secrets here; the file is in your repository.
android_signingKeystore reference names. See Android code signing.
ios_signingAutomatic or manual signing. See iOS code signing.

versioning

    versioning:
      source: google_play         # google_play | app_store_connect | manual
      tracks: [internal, production]   # google_play only; default: all tracks
      offset: 0                   # added to the fetched number; default 0

Sets AR_BUILD_NUMBER to one more than the highest build number found. With manual, it is the release's own sequence number.

triggering

    triggering:
      events:
        - push
        - tag
      branch_patterns:
        - pattern: main
          include: true
          source: true
      tag_patterns:
        - pattern: "v*"
          include: true
      cancel_previous_builds: true

Requires the repository webhook, which the console shows under the app's Settings → Webhooks. Without a triggering section, releases start only by hand.

cache

    cache:
      cache_paths:
        - $HOME/.pub-cache
        - $HOME/.gradle/caches
        - $AR_BUILD_DIR/ios/Pods

scripts

    scripts:
      - name: Get packages
        script: flutter pub get
      - name: Test
        script: flutter test
        ignore_failure: false     # default
      - name: Build
        script: |
          flutter build appbundle --release \
            --build-number=$AR_BUILD_NUMBER
        working_directory: .      # relative to AR_BUILD_DIR

Scripts run in order with bash -e. The first failure stops the workflow unless ignore_failure is set. Everything they print goes to the live log; secrets are masked.

artifacts

    artifacts:
      - build/**/outputs/**/*.aab
      - build/ios/ipa/*.ipa
      - flutter_drive.log

Glob patterns relative to AR_BUILD_DIR. Matching files are kept for the plan's retention period and are what the publishing steps upload.

publishing

    publishing:
      email:
        recipients: [team@example.com]
        notify: { success: true, failure: true }
      google_play:
        credentials: $GOOGLE_PLAY_SERVICE_ACCOUNT
        track: internal
      app_store_connect:
        auth: integration
        submit_to_testflight: true
      scripts:                     # runs after publishing, success or not
        - name: Notify
          script: curl -X POST "$WEBHOOK" -d "status=$AR_BUILD_STATUS"

See Google Play and App Store Connect for every key.

Environment variables

Set by the runner before the first script.

VariableValue
CItrue
AR_BUILD_DIRAbsolute path of the checked-out repository
AR_BUILD_IDId of the release in AppRelease
AR_BUILD_NUMBERNext build number, see versioning
AR_BUILD_STATUSsuccess or failure, in post-publishing scripts
AR_WORKFLOWWorkflow id
AR_BRANCHBranch name
AR_TAGTag name, if the release was started by a tag
AR_COMMITFull commit SHA
AR_COMMIT_SHORTFirst seven characters
AR_FLUTTER_VERSIONThe Flutter version that was installed
AR_KEYSTORE_PATH …Android signing, see Android code signing
AR_EXPORT_OPTIONS …iOS signing, see iOS code signing
AR_ARTIFACT_DIRWhere collected artifacts are copied