本文へ移動
cccskills
無料GitHub で公開

deploying-with-fastlane

Automates Flutter iOS and Android deployment using Fastlane. Use when setting up `fastlane match` for iOS certificate and provisioning profile management, automating TestFlight uploads via `upload_to_testflight`, pushing Android releases to Google Play via `upload_to_play_store`, auto-incrementing build numbers, writing Fastfile lanes for Flutter release workflows, integrating Fastlane with GitHub Actions or Codemagic, or configuring App Store Connect API Key and Google Play Service Account JSON credentials.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md4.9 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Flutter combined with Fastlane Best Practices (CI/CD - Deployment)

Goal

Implements Fastlane for iOS/Android building, code signing, and deployment. Fastlane is an open-source Ruby script toolset. Although it is not a cloud CI platform (like GitHub Actions), it can run on top of any CI platform. It is widely recognized as the ultimate tool for handling the tedious compilation, certification, and submission processes for iOS/Android.

Instructions

1. Separation of Responsibilities

In Flutter development, the best way to combine tools is:

  • Flutter CLI (flutter build): Responsible for compiling Dart code into native iOS projects or Android Bundles (AAB).
  • Fastlane (fastlane gym/supply/deliver): Takes over subsequent Xcode/Gradle building, handling complex "Code Signing" and pushing to stores (TestFlight / Google Play Console).

2. Solving iOS Certificate Pain Points: fastlane match (⭐️ Absolutely Essential)

The most painful part of iOS development is syncing Certificates and Provisioning Profiles when a new team member joins.

fastlane match solution: Encrypt all certificates and centrally manage them in a private Git Repo.

2.1 Environment Setup & Usage

  1. Create a Private GitHub Repository (e.g., ios-certificates).
  2. Run fastlane match init in the terminal to align with the repository URL.
  3. Run fastlane match appstore, which will automatically connect to the Apple Server, revoke unused certificates, generate brand new ones, and encrypt and push them to the Git Repo.

2.2 Match in the CI Environment

On any fresh CI machine, you only need one lane in your Fastfile:

lane :beta do
  # 🌟 The machine instantly automatically downloads, decrypts, and installs all certificates!
  match(type: "appstore", readonly: is_ci) 
  
  # Start building
  gym(workspace: "Runner.xcworkspace", scheme: "Runner") 
end

3. Auto-Incrementing Version Numbers

App Store requires that the Build Number (e.g., the 123 in 1.0.0+123) increments with every upload.

Best Practice: Do not update this manually. Let Fastlane fetch the latest number from the store and increment it.

3.1 Android Incrementing

Use plugins, directly read/write pubspec.yaml, or use Fastlane's native API:

lane :release_android do
  # Fetch the current latest version number from Google Play
  play_track_version = google_play_track_version_codes(
    package_name: "com.example.app",
    track: "production"
  )[0]
  
  new_build_number = play_track_version + 1
  # Combine with a script to write back to pubspec.yaml or gradle
end

3.2 iOS Incrementing

iOS has an excellent built-in action:

lane :release_ios do
  # 🌟 Automatically fetch the latest number from App Store Connect and add 1
  increment_build_number(
    build_number: latest_testflight_build_number + 1 
  )
end

4. Push to Store (Play Store & App Store)

Once the Fastfile is configured, your deployment process is simplified to a single command.

4.1 Push Android to Google Play Console

Requires setting up a Google Play Service Account JSON key.

# android/fastlane/Fastfile
lane :deploy_beta do
  # 1. (Done externally) run flutter build appbundle --release
  
  # 2. Automatically upload to internal testing track
  upload_to_play_store(
    track: 'internal',
    aab: '../build/app/outputs/bundle/release/app-release.aab',
    json_key: ENV['PLAY_STORE_JSON_KEY_PATH'] # 🌟 CI Variable
  )
end

4.2 Push iOS to TestFlight

Requires setting up an App Store Connect API Key.

# ios/fastlane/Fastfile
lane :deploy_testflight do
  # 1. Fetch API Key (Replaces traditional two-factor auth Apple accounts)
  app_store_connect_api_key(
    key_id: ENV['ASC_KEY_ID'],
    issuer_id: ENV['ASC_ISSUER_ID'],
    key_filepath: ENV['ASC_KEY_PATH']
  )

  # 2. Pull certificates
  match(type: "appstore")

  # 3. Build IPA in Xcode
  gym(workspace: "Runner.xcworkspace", scheme: "Runner")

  # 4. 🌟 Upload to TestFlight and automatically email testers
  upload_to_testflight(
    skip_waiting_for_build_processing: true
  )
end

Constraints

  • Ensure that the Fastlane scripts are kept within the repository.
  • Once setup, CI simply calls bundle exec fastlane deploy_testflight to achieve full deployment automation.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Declarative animation patterns using flutter_animate v4.5.x with composable effects (fade, scale, slide, shimmer, shake, blur), GLSL fragment shaders, and scroll-synchronized animations. Use this skill for adding UI animations and transitions, building staggered or sequenced effects, creating custom animation effects, fixing animation jank or performance issues, implementing shimmer loading states, or adding scroll-driven animations. Supports delays, curves, adaptive effects, and easy extension method chaining (.animate()).

日本語の概要は準備中です。原文の説明を表示しています。

Poorgramer-Zack/dart-expert-skills72026年8月11日 更新

Dart 3 modern features (through 3.10) and Effective Dart best practices including records, patterns, sealed classes, dot shorthands, null-aware collection elements, and wildcard variables. Use when adopting Dart 3.7+ syntax, using dot shorthands for enums or static members, using null-aware elements in lists or maps, using wildcard _ parameters, improving code quality, or reviewing Dart code conventions.

日本語の概要は準備中です。原文の説明を表示しています。

Poorgramer-Zack/dart-expert-skills72026年8月11日 更新

Expert-level guidance for Flutter production applications: architecture decisions (Clean/Layered/Hexagonal/Feature-First), advanced state management (BLoC/Riverpod/GetX), performance optimization (eliminating jank, memory profiling, reducing rebuild overhead), code review with design pattern enforcement, scalability assessments, native platform integration (MethodChannel/EventChannel/FFI), complex UI challenges (custom render objects, slivers), testing strategies (unit/widget/integration/golden), CI/CD pipeline architecture, build optimization, and accessibility compliance. Triggers: 'architecture decision', 'design pattern', 'performance issue', 'code review', 'production problem', 'scaling concerns', 'best practices', 'technical debt', 'refactoring strategy'. Essential for complex enterprise apps, critical production debugging, architectural refactors, or when choosing between competing technical approaches.

日本語の概要は準備中です。原文の説明を表示しています。

Poorgramer-Zack/dart-expert-skills72026年8月11日 更新

Builds SEO-friendly web applications with Dart using the Jaspr framework. Use when creating Dart-based websites, blogs, or landing pages requiring semantic HTML output; implementing server-side rendering (SSR) or static site generation (SSG); adding Tailwind CSS via jaspr_tailwind; routing with jaspr_router; testing components with jaspr_test; or building full-stack Dart web apps where Flutter Web's canvas rendering is unsuitable.

日本語の概要は準備中です。原文の説明を表示しています。

Poorgramer-Zack/dart-expert-skills72026年8月11日 更新

shadcn_flutter UI component library for building accessible, themed Flutter interfaces. Use when integrating shadcn components, configuring design system theming, or building consistent widget layouts.

日本語の概要は準備中です。原文の説明を表示しています。

Poorgramer-Zack/dart-expert-skills72026年8月11日 更新

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.

日本語の概要は準備中です。原文の説明を表示しています。

Poorgramer-Zack/dart-expert-skills72026年8月11日 更新

Poorgramer-Zack のスキルをすべて見る

このスキルの問題を報告する