configuring-github-actions
Skill7 starsChanged 8 months agoMITView on GitHub
Configures GitHub Actions CI/CD workflows for Flutter projects. Use when creating or editing `.github/workflows/` YAML files for Flutter, integrating subosito/flutter-action, automating `flutter test`, `flutter analyze`, or `dart format` on push or pull_request events, running build_runner in CI, building Android AAB or iOS IPA artifacts, managing keystore or signing secrets in GitHub Secrets, or combining GitHub Actions with Fastlane or Codemagic for the deployment stage.
In this repository41 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- skill-creatorSkill
- flutter-dbSkill
- flutter-routingSkill
- flutter-state-managementSkill
- configuring-codemagicSkill
- 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
- 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
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
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 19
Bind the Flutter Version: Never use channel: stable or let it automatically fetch the latest version.
- Very specific: line 60
If the project uses packages relying on build_runner (like Freezed, Riverpod, go_router builder), you must execute code generation before …
- Very specific: line 63
If it is a Pull Request check, use build_runner build --delete-conflicting-outputs to ensure a clean generation state.
- Distinctive: line 88
If setting up a CD (Continuous Deployment) pipeline, you can automatically build an AAB after tests pass.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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 GitHub Actions Best Practices (CI/CD)
Goal
Implements robust CI/CD pipelines using GitHub Actions for Flutter projects. GitHub Actions is the most popular CI/CD platform for open-source and small-to-medium projects. By configuring YAML files under .github/workflows/, you can achieve high automation.
Instructions
1. Environment Setup & Core Setup
In all Flutter Workflows, the core package to use is the third-party maintained subosito/flutter-action.
Best Practices:
- Bind the Flutter Version: Never use
channel: stableor let it automatically fetch the latest version. Explicitly specifyflutter-versionor useflutter-version-file: pubspec.yamlto guarantee the CI environment exactly matches the local development environment. - Enable Cache:
flutter pub getis a time-consuming step. Always enablecache: true.
name: Flutter CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build_and_test:
runs-on: ubuntu-latest # If not building iOS, Ubuntu is the fastest and cheapest
steps:
- name: 📦 Checkout repository
uses: actions/checkout@v4
- name: 🐦 Setup Flutter (Standard or FVM)
uses: subosito/flutter-action@v2
with:
# 🌟 Standard Best Practice: Read from pubspec.yaml
# flutter-version-file: pubspec.yaml
# 🌟 FVM Best Practice: If your team uses FVM, read directly from the FVM config!
flutter-version-file: .fvmrc # Or .fvm/fvm_config.json for older FVM versions
cache: true # 🌟 Enable pub-cache to significantly speed up subsequent builds
# [Optional] If your strict project requirements dictate that all commands MUST be executed via `fvm flutter ...` instead of natively, you must activate the FVM CLI globally:
# - name: 🛠️ Install FVM CLI
# run: dart pub global activate fvm
- name: ⬇️ Get packages
# If FVM CLI is installed, this becomes: `fvm flutter pub get`
run: flutter pub get2. Code Generation
If the project uses packages relying on build_runner (like Freezed, Riverpod, go_router builder), you must execute code generation before testing or compiling.
Best Practice:
If it is a Pull Request check, use build_runner build --delete-conflicting-outputs to ensure a clean generation state.
- name: ⚙️ Run build_runner
run: dart run build_runner build --delete-conflicting-outputs3. Analyze & Test
This is the core defense line of CI (Continuous Integration), and it's recommended to strictly require passing these for every PR.
# 🌟 Check if code formatting follows Dart guidelines (trailing commas, indentation)
- name: 🔎 Analyze Formatting
run: dart format --output=none --set-exit-if-changed .
# 🌟 Run static analysis to ensure no warnings or lint errors
- name: 🚨 Analyze Code
run: flutter analyze --no-fatal-warnings
# 🌟 Run Unit and Widget Tests (If there are integration tests, set up another job with emulators)
- name: 🧪 Run Tests
run: flutter test --coverage4. Build Bundle (Android Example)
If setting up a CD (Continuous Deployment) pipeline, you can automatically build an AAB after tests pass.
- name: 🔨 Build Android App Bundle (AAB)
run: flutter build appbundle --release
# Upload the built file to GitHub Actions Artifacts for manual download
- name: 📤 Upload Artifact
uses: actions/upload-artifact@v4
with:
name: release-aab
path: build/app/outputs/bundle/release/app-release.aab5. Deployment and Key Management (Keystore & App Store)
The downside of GitHub Actions is that it isn't great at handling native certificates.
- Android: You need to convert the
keystoreinto a Base64 string, store it in GitHub Secrets, and use a script in the Workflow to convert it back to a file. - iOS: More complicated, requiring the handling of Certificates and Provisioning Profiles.
Constraints
- GitHub Actions should primarily be used for CI: In the Flutter ecosystem, GitHub Actions is typically only used for CI (Analyze, Test, Build_runner) to ensure code quality.
- Delegate specific deployments to specialized tools: For actual building and deployment (pushing to App Store/Play Console), delegate to tools optimized for mobile development, like Fastlane or Codemagic (which natively supports Flutter).
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.

