flutter-ci
/flutter-ci
Konfiguruje CI/CD dla Flutter i Dart w GitHub Actions: bramki jakości, budowanie APK i IPA oraz podpisywanie.
- Autor
- Dee9975 ↗
- Repozytorium
- cc-skills-flutter ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 05.11.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 05.11.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Konfiguruje CI/CD dla Flutter i Dart w GitHub Actions: bramki jakości, budowanie APK i IPA oraz podpisywanie.
Oryginalny opis (EN)
CI/CD for Flutter and Dart — GitHub Actions workflows with subosito/flutter-action (pinned Flutter version, caching), quality gates (format, analyze, test, coverage), build_runner in CI, building Android APK/AAB and iOS IPA, code signing (Android keystore via secrets, iOS certificates/profiles with fastlane match), flavors and --dart-define-from-file, --obfuscate/--split-debug-info, versioning (build-name/build-number), store delivery via fastlane or Codemagic, Firebase App Distribution, web deploys, and Shorebird code push. Use when setting up or fixing a Flutter pipeline, automating releases
Jak działa
- PR workflow (GitHub Actions)
- Android release build
- iOS release build
- Versioning
- Delivery options
- Secrets and config
- Speed
Podgląd SKILL.md
---
name: flutter-ci
description: "CI/CD for Flutter and Dart — GitHub Actions workflows with subosito/flutter-action (pinned Flutter version, caching), quality gates (format, analyze, test, coverage), build_runner in CI, building Android APK/AAB and iOS IPA, code signing (Android keystore via secrets, iOS certificates/profiles with fastlane match), flavors and --dart-define-from-file, --obfuscate/--split-debug-info, versioning (build-name/build-number), store delivery via fastlane or Codemagic, Firebase App Distribution, web deploys, and Shorebird code push. Use when setting up or fixing a Flutter pipeline, automating releases, or adding quality gates."
license: MIT
metadata:
author: Matiss Kalnins
version: "0.5.0"
---
**Persona:** You make CI the gatekeeper. Every PR is formatted, analyzed, and tested on a pinned Flutter version, and releases are built by the pipeline, never on a laptop.
## PR workflow (GitHub Actions)
```yaml
# .github/workflows/ci.yml
name: CI
on:
pull_request:
push:
branches: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version-file: pubspec.yaml # or .fvmrc; or flutter-version: 3.x.y
channel: stable
cache: true
- run: flutter pub get --enforce-lockfile
- run: dart run build_runner build -d # generated files are gitignored, so always generate
- run: dart format --output=none --set-exit-if-changed .
- run: flutter analyze --fatal-infos
- name: No var declarations
run: |
! grep -rnE --include='*.dart' --exclude='*.g.dart' --exclude='*.freezed.dart' \
'(^|[^A-Za-z0-9_$.])var[[:space:]]+[A-Za-z_$(]' lib test
- name: No try/catch outside Result.guard
run: |
! grep -rnE --include='*.dart' --exclude='*.g.dart' --exclude='*.freezed.dart' \
'\bcatch\b|\bon [A-Z][A-Za-z]*(Exception|Error)\b' lib | grep -v '^lib/src/core/result/'
- name: No Future callback chaining
run: |
! grep -rnE --include='*.dart' --exclude='*.g.dart' --exclude='*.freezed.dart' \
'\.(then|catchError|whenComplete|onError)\(' lib test
- name: No AsyncValue.when-style callbacks
run: |
! grep -rnE --include='*.dart' --exclude='*.g.dart' --exclude='*.freezed.dart' \
'\.(when|maybeWhen|whenOrNull|whenData|maybeMap|mapOrNull)\(' lib test
- name: Dot shorthands for common Flutter enums
run: |
! grep -rnE --include='*.dart' --exclude='*.g.dart' --exclude='*.freezed.dart' \
'(:|==|!=|case|=>)[[:space:]]*(const[[:space:]]+)?(MainAxisAlignment|CrossAxisAlignment|MainAxisSize|TextAlign|TextOverflow|FontWeight|BoxFit|Clip|Axis|Brightness|ThemeMode|EdgeInsets|BorderRadius|Alignment)\.' lib test
- name: Imports go through barrels
run: |
! grep -rnE --include='*.dart' --exclude='*.g.dart' --exclude='*.freezed.dart' \
'^import "package:[a-z_]+/src/[a-z_]+/[a-z_]+/' lib test
- name: No else / else if
run: |
! grep -rnE --include='*.dart' --exclude='*.g.dart' --exclude='*.freezed.dart' \
'\belse\b' lib test | grep -vE '^[^:]+:[0-9]+:[[:space:]]*//' # skip comment lines
- run: flutter test --coverage
- uses: codecov/codecov-action@v5 # optional
with: { files: coverage/lcov.info }
```
- **Pin the Flutter version** (via `environment: flutter:` in `pubspec.yaml`, `.fvmrc`, or an explicit version). An unpinned `stable` breaks builds when Flutter releases.
- Run golden tests only on the OS that generated them (usually Linux).
- In monorepos, use `melos run test` or a matrix over packages.
## Android release build
```yaml
android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with: { distribution: temurin, java-version: '17' }
- uses: subosito/flutter-action@v2
with: { flutter-version-file: pubspec.yaml, cache: true }
- name: Decode keystore
run: echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 -d > android/app/upload.jks
- name: key.properties
run: |
cat > android/key.properties <<EOF
storeFile=upload.jks
storePassword=${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}
keyPassword=${{ secrets.ANDROID_KEY_PASSWORD }}
EOF
- name: Write .env from CI variables
run: echo "WEB_API_URL=${{ vars.WEB_API_URL }}" > .env
- run: |
flutter build appbundle --release \
--build-number=${{ github.run_number }} \
--dart-define-from-file=.env \
--obfuscate --split-debug-info=build/symbols
- uses: actions/upload-artifact@v4
with: { name: aab, path: build/app/outputs/bundle/release/*.aab }
```
- `android/app/build.gradle(.kts)` reads `key.properties` for the release `signingConfig`. Never commit the keystore or `key.properties`.
- Use Play App Signing. The key in CI is the **upload** key.
- Upload symbols (`build/symbols`, plus the native debug symbols) to Crashlytics or Sentry so obfuscated stack traces can be decoded.
## iOS release build
- Needs a `macos-latest` runner (expensive, so trigger it on tags or the release branch only).
- Manage certificates and profiles with **fastlane match** (certs in an encrypted git repo), or import them with `apple-actions/import-codesign-certs`. Authenticate to App Store Connect with an **API key** (`.p8`), not an Apple ID plus 2FA.
- Build with `flutter build ipa --release --export-options-plist=ios/ExportOptions.plist --build-number=...`, then upload with `fastlane pilot` / `xcrun altool` / `apple-actions/upload-testflight-build`.
## Versioning
- In `pubspec.yaml`, `version: 1.4.2+57` means build-name `1.4.2` and build-number `57`. Override them in CI with `--build-name` / `--build-number`. The build number must increase for every store upload. `github.run_number` is a simple source.
- Tag releases (`v1.4.2`) and trigger release workflows on `push: tags: ['v*']`.
## Delivery options
| Need | Tool |
| --- | --- |
| Internal testers fast | Firebase App Distribution, TestFlight internal |
| Store upload + metadata | fastlane (`supply` for Play, `deliver`/`pilot` for Apple) |
| Hosted Flutter-specific CI/CD | Codemagic, Bitrise |
| Over-the-air Dart patches | Shorebird (`shorebird release` / `shorebird patch`) |
| Web | `flutter build web --release` → Firebase Hosting, GitHub Pages, Cloudflare Pages (set `--base-href` for subpaths) |
## Secrets and config
- Keep keystores, `.p8` keys, `google-services.json` for production, and API tokens in CI secrets.
- Config comes from a `.env` file (gitignored locally, written from CI variables in the pipeline) passed with `--dart-define-from-file=.env` (see `flutter-project-layout`). It's for non-secret config. Anything compiled into the app can be extracted, so real secrets belong on a backend.
## Speed
- Cache pub with `cache: true`, Gradle with `actions/setup-java`'s `cache: gradle`, and CocoaPods by caching `ios/Pods` keyed on `Podfile.lock`.
- Split jobs: run the fast `check` job on every PR, and release builds only on main or tags.
- Use `paths:` filters in monorepos so docs-only changes skip mobile builds.
Wersje
W bazie nie ma innych skilli o nazwie flutter-ci.
Migawka bazy z 13.11.2026 · wersja paczki e858576d9897 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100fastlane-knowledge
Podaje wzorce konfiguracji Fastlane dla aplikacji Flutter: lane'y iOS i Android, podpisywanie przez match, CI/CD w GitHub Actions i zarządzanie środowiskami. - 100flutter-cicd
Konfiguruje pipeline CI/CD dla aplikacji Flutter: automatyczne testy, budowanie i wdrażanie z użyciem GitHub Actions lub Fastlane. - 100mobile-cicd
Konfiguruje CI/CD dla aplikacji mobilnych: Fastlane, GitHub Actions, podpisywanie kodu (iOS i Android), dystrybucję beta przez TestFlight i Firebase App Distribution oraz zgłoszenia do sklepów. - 100flutter-release
Buduje, podpisuje i wysyła aplikację Flutter do testerów i sklepów przez Fastlane oraz CI, także z podpisami iOS. - 100release
Przygotowuje wydanie aplikacji Flutter: podbija wersję, changelog, flavory, obfuskowane buildy AAB i IPA oraz listę kontrolną sklepu. - 100flutter-release-engineering
Pomaga ustawić lub zrecenzować wydawanie aplikacji Flutter: flavory i konfiguracja środowisk, podpisywanie, macierz builda, numery wersji, metadane sklepów i aktualizacje OTA przez Shorebird.