Codemagic set my build as canceled although it was successful #2642
-
If you are looking for help, please confirm the following...
Which mobile framework are you using?Flutter (Dart) Steps to reproduce
I have a post-script which will commit and push the changes (change version in pubspec.yaml and generate release notes). I need the build to be successful so that next automated build (triggered after push the changes from previous build) will stop after fetching sources. stage-workflow:
name: Build and Release Stage App
max_build_duration: 120
integrations:
app_store_connect: XXX
environment:
groups:
- android
- aws-keys
- firebase-credentials
- stage
- version
flutter: $FLUTTER_VERSION
xcode: $XCODE_VERSION
cocoapods: $COCOAPODS_VERSION
android_signing:
- XXX
ios_signing:
distribution_type: app_store
bundle_identifier: $BUNDLE_ID
vars:
APP_STORE_APPLE_ID: $APP_STORE_APPLE_ID
cache:
cache_paths:
- $HOME/.gradle/caches
- $HOME/Library/Caches/CocoaPods
- $FLUTTER_ROOT/.pub-cache
triggering:
events:
- push
branch_patterns:
- pattern: release-*
include: true
cancel_previous_builds: true
when:
changeset:
excludes:
- 'pubspec.yaml'
- 'release_notes_*.txt'
scripts:
- name: Set permission for scripts
script: |
chmod +x scripts/codemagic/*
- name: Generate release notes
script: |
scripts/codemagic/gen_release_notes.sh
- name: Set pubspec version
script: |
scripts/codemagic/set_pubspec_version.sh
- name: Install Firebase CLI
script: |
scripts/codemagic/install_firebase_cli.sh
- name: Install AWS Encrytion SDK CLI
script: |
scripts/codemagic/install_aws_encryption_sdk_cli.sh
- name: Set AWS Access
script: |
scripts/codemagic/set_aws_access.sh $AWS_KEY_ID $AWS_SECRET_ACCESS_KEY
- name: Decrypt secrets using AWS Encryption CLI
script: |
scripts/codemagic/decrypt_secrets.sh $KMS_ARN_KEY stage
- name: Set up local.properties
script: |
echo "flutter.sdk=$HOME/programs/flutter" > "$CM_BUILD_DIR/android/local.properties"
- name: Clean Flutter
script: |
scripts/codemagic/flutter_clean.sh
- name: Get Flutter packages
script: |
scripts/codemagic/flutter_get.sh
- name: Generate localisation
script: |
scripts/codemagic/flutter_gen_localisation.sh
- name: Build AAB with Flutter
script: |
scripts/codemagic/flutter_build_aab.sh stage $ANDROID_FIREBASE_APP_ID
- name: Set up code signing settings on Xcode project
script: |
scripts/codemagic/code_signing_profiles.sh
- name: Install pods
script: |
scripts/codemagic/pod_install.sh
- name: Build IPA with Flutter
script: |
scripts/codemagic/flutter_build_ipa.sh stage
- name: Remove decrypted secrets after build
script: |
scripts/codemagic/remove_decrypted_secrets.sh stage
artifacts:
- build/**/outputs/bundle/**/*.aab
- build/**/outputs/**/mapping.txt
- build/ios/ipa/*.ipa
- build/ios/archive/*.xcarchive
- /tmp/xcodebuild_logs/*.log
- $HOME/Library/Developer/Xcode/DerivedData/**/Build/**/*.dSYM
- flutter_drive.log
publishing:
firebase:
firebase_service_account: $FIREBASE_SERVICE_ACCOUNT
android:
app_id: $ANDROID_FIREBASE_APP_ID
groups:
- qa
- developer
artifact_type: aab
app_store_connect:
auth: integration
submit_to_testflight: true
slack:
channel: $SLACK_CHANNEL
notify_on_build_start: true
notify:
success: true
failure: true
scripts:
- name: Upload debug symbols to Firebase Crashlytics
script: |
scripts/codemagic/upload_debug_symbols.sh $CM_BUILD_DIR Stage $ANDROID_FIREBASE_APP_ID $FIREBASE_CLI_TOKEN
- name: Commit changes to Gitlab
script: |
scripts/codemagic/git_commit_push.sh Expected results
Actual results
Build id (optional)669e0e12612f74af82bc56b9 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
hey @anderscheow the build is skipped because your workflow includes the flag |
Beta Was this translation helpful? Give feedback.
-
I'm tentatively closing the discussion since we haven't heard back from you. You can open the discussion again by replying to this message or opening a new discussion. |
Beta Was this translation helpful? Give feedback.
hey @anderscheow the build is skipped because your workflow includes the flag
cancel_previous_builds: true
. This flag automatically cancels all ongoing and queued builds triggered by webhooks on push or pull request commits when a more recent build is triggered for the same branch. This means that the build was triggered before the current one finished. Try removing this flag from your workflow