configuring-codemagic
Skill7 starsChanged 8 months agoMITView on GitHub
Configures Codemagic CI/CD pipelines for Flutter using `codemagic.yaml`. Use when setting up automated Flutter builds on Codemagic, configuring iOS code signing without Fastlane Match, deploying to App Store Connect or Google Play from Codemagic, caching pub dependencies in Codemagic, setting up encrypted environment variable groups, running tests with Codemagic's test dashboard, or choosing between Codemagic and GitHub Actions + Fastlane for a Flutter CI/CD pipeline.
In this repository41 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- skill-creatorSkill
- flutter-dbSkill
- flutter-routingSkill
- flutter-state-managementSkill
- applying-effective-dartSkill
- deploying-with-fastlaneSkill
- integrating-firebaseSkill
- implementing-fl-chartSkill
- integrating-google-adsSkill
- animating-flutter-widgetsSkill
- routing-with-autorouteSkill
- implementing-flutter-blocSkill
- configuring-deep-linksSkill
- persisting-data-with-driftSkill
- building-flutter-production-appsSkill
- generating-flutter-uiSkill
- routing-with-gorouterSkill
- managing-hive-storageSkill
- using-flutter-hooksSkill
- running-flutter-isolatesSkill
- managing-flutter-provider-stateSkill
- implementing-responsive-layoutsSkill
- implementing-riverpodSkill
- managing-secure-storageSkill
- flutter-setupSkill
- managing-shared-preferencesSkill
- implementing-flutter-social-authSkill
- flutter-testingSkill
- using-fpdartSkill
- generating-freezed-modelsSkill
- configuring-github-actionsSkill
- building-jaspr-web-appsSkill
- testing-with-marionetteSkill
- implementing-openapi-in-dartSkill
- integrating-revenuecatSkill
- integrating-sentrySkill
- developing-serverpod-backendSkill
- building-shadcn-flutter-uiSkill
- integrating-supabaseSkill
- converting-ts-to-dartSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Place codemagic.yaml in the project root.
- Very specific: line 50
Before building, utilize the scripts block to execute commands sequentially.
- Very specific: line 127
Prefer codemagic.yaml over the Codemagic UI workflow editor — keeping pipeline configuration in the repository alongside source code is the …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Flutter combined with Codemagic Best Practices (YAML approach)
Goal
Implements Codemagic YAML configurations for Flutter deployment. Codemagic natively understands Flutter, requires no extra tooling for code signing, and provides Apple M-series machines for fast iOS compilation.
Instructions
The recommended approach is using codemagic.yaml for "Infrastructure as Code," maintaining it within the project repository alongside the source code.
1. Infrastructure and Cache Strategy
Place codemagic.yaml in the project root. A single file can contain multiple Workflows (e.g., executing iOS deployments and Android deployments separately).
Best Caching Practice: Caching is fundamental to saving CI costs. Be sure to cache Dart dependencies and native build tools.
# 🌟 codemagic.yaml
workflows:
android-release:
name: Android Release Workflow
instance_type: mac_mini_m1 # Specify M1 machine for acceleration
environment:
# 🌟 Specify the Flutter version
flutter: stable
cache:
cache_paths:
- $HOME/.pub-cache # Dart packages
- $HOME/.gradle/caches # Gradle dependencies2. Environment Variables & Encrypted Keys
NEVER hardcode Keystore passwords or API Keys in the YAML file. Codemagic provides highly secure UI dashboards to create variable groups, encrypt them, and consume them via scripts.
environment:
flutter: stable
groups:
# Pre-configured group names on the Codemagic UI
- keystore_credentials # Contains $KEY_PASSWORD, $ALIAS_PASSWORD
- google_play_credentials # Contains the JSON key path for the Google Service Account3. Analyze, Generate & Test
Before building, utilize the scripts block to execute commands sequentially.
scripts:
- name: ⬇️ Fetch Dependencies
script: flutter packages pub get
- name: ⚙️ Code Generation (build_runner)
script: dart run build_runner build --delete-conflicting-outputs
- name: 🚨 Static Analysis
script: flutter analyze
- name: 🧪 Unit & Widget Tests
script: flutter test
# 🌟 Codemagic automatically parses the test results and displays them on a sleek Web Dashboard
test_report: build/test-results/flutter.json 4. Build Bundle / IPA
Codemagic's greatest strength lies in condensing complex Code Signing flows into extremely minimalist declarative syntax.
4.1 Android Building (with Keystore)
- name: 🔨 Build Android App Bundle
script: |
# Generate a key.properties for android/app/build.gradle to read
echo "storePassword=$KEYSTORE_PASSWORD" >> android/key.properties
echo "keyPassword=$KEY_PASSWORD" >> android/key.properties
echo "keyAlias=$KEY_ALIAS" >> android/key.properties
echo "storeFile=$KEYSTORE_PATH" >> android/key.properties
# 🌟 The build action
flutter build appbundle --release4.2 iOS Code Signing
You typically do not need to manually configure Fastlane Match. Upload your App Store Connect API Key via Codemagic's Web Dashboard, and it automatically handles certificate fetching:
environment: # Declare before Workflow logic: Enable Auto Signing
ios_signing:
distribution_type: app_store
bundle_identifier: com.yourcompany.app
scripts:
- name: 🍏 Build iOS IPA
script: flutter build ipa --release5. Push to Store (Publishing)
Once the build concludes, declare the target artifacts, and automatically push directly to the stores utilizing built-in modules—no upload scripting required!
artifacts:
- build/app/outputs/bundle/release/**/*.aab
- build/ios/ipa/*.ipa
publishing:
# Auto-email the team
email:
recipients:
- devteam@company.com
# 🌟 Publish to Google Play (Internal Track)
google_play:
credentials: $GCP_SERVICE_ACCOUNT_CREDENTIALS # The JSON key variable
track: internal
# 🌟 Publish to App Store Connect / TestFlight
app_store_connect:
auth: integration # Corresponds to the integrated Apple account from the Dashboard
submit_to_testflight: trueConstraints
- Prefer
codemagic.yamlover the Codemagic UI workflow editor — keeping pipeline configuration in the repository alongside source code is the recommended "Infrastructure as Code" approach. - For teams already using Fastlane, Codemagic can still call
bundle exec fastlane <lane>from itsscriptsblock; the two tools are not mutually exclusive.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

