Flutter CI/CD With GitHub Actions for App Store and Play

· 5 min read

A robot at a laptop under three windows joined by arrows: test, then build, then ship

Continuous integration checks every change. Continuous delivery gets builds to testers without manual steps. For a Flutter app that ships to two stores, automation saves hours and prevents the mistakes people make when they build releases by hand. It also adds new ways to leak a signing key or publish something by accident. This page covers what to automate, a sensible set-up with GitHub Actions and fastlane, and where to keep a human in the loop. It uses Flutter’s continuous delivery guide, GitHub’s and fastlane’s documentation, read on the day this post was written, and the release rules MobileKit follows.

What Flutter documents

Flutter’s guide says continuous delivery gets your app “delivered to your beta testers and validated on a frequent basis without resorting to manual workflows.” It lists two families of option:

  • All-in-one services with built-in Flutter functionality: Codemagic, Bitrise and Appcircle.
  • fastlane integrated with your existing workflows: GitHub Actions, Cirrus, Travis, GitLab and CircleCI.

fastlane is described as “an open-source tool suite to automate releases and deployments for your app”. Flutter recommends you “test the build and deployment process locally before migrating to a cloud-based system”, and its example commands build with flutter build appbundle for Android, with an iOS build alongside. Set up fastlane for each platform’s project folder.

Two jobs: check and deliver

Split the automation into two workflows.

1. Check on every push or pull request. Run the same three commands you use locally:

flutter analyze
dart format --set-exit-if-changed .
flutter test

A failing check blocks the merge. This is cheap, fast and runs on a Linux runner.

2. Deliver on a tag or a manual trigger. Build the release for each platform and upload it to a test track: TestFlight for iOS, an internal or closed testing track for Android. fastlane has actions for both: upload_to_testflight and upload_to_play_store.

GitHub-hosted runners are available “with Ubuntu Linux, Windows, or macOS operating systems”, so the iOS build runs on a macOS runner and everything else can run on Linux. Check GitHub’s current pricing and limits for macOS minutes, and keep the iOS job to the delivery workflow.

Secrets and signing

This is where CI goes wrong. Rules:

  • Signing keys, passwords and store API keys are secrets. They go in your CI provider’s secret store. GitHub documents using secrets in Actions workflows. They never go in the repository.
  • Android: the upload keystore and its passwords. Flutter’s Android guide describes a key.properties file for local builds and says to keep it private. In CI, write the file from secrets at build time.
  • iOS: certificates and provisioning, or automatic signing with an App Store Connect API key. Keep that key in secrets.
  • Back up the Android upload key outside the repo. Losing it blocks every future update.
  • Do not print secrets in logs. Check that your scripts do not echo them.

The release rules, from MobileKit

MobileKit’s release stage encodes lessons that apply to any pipeline:

  1. Raise the build number for every upload. A store rejects a build number it has seen. Have CI set it from a counter.
  2. Sign with the upload key, not a debug key.
  3. Upload debug symbols to your crash reporter after every build, or stack traces will be unreadable.
  4. Set the export compliance key in the iOS configuration, so TestFlight builds do not wait on a “Missing Compliance” question.
  5. Check what shipped. Install the store build on a real phone from the test track, make a purchase in the sandbox and check the binary has what the listing promises.
  6. Every upload and every public release needs a person’s yes. The pipeline stops before anything becomes public.

Rule six is the one to keep even in a fully automated setup: let CI get a build to the test tracks, and make going public a manual step in the store console, taken by someone who has read the checklist. See the App Store submission checklist and the Google Play launch checklist.

Using Claude Code to build the pipeline

Claude Code is good at writing workflow files and fastlane lanes and bad at knowing your secrets. A sound division of labour:

  • It writes the workflow and lane files, and explains each step.
  • You create the secrets in the provider’s UI and tell it only their names.
  • It runs the check workflow locally first, with the same three commands.
  • You review any step that touches signing or uploads before it merges.

Prompts that work:

  • “Write a GitHub Actions workflow that runs flutter analyze, the format check and flutter test on every pull request, on Ubuntu. Do not add any deployment.”
  • “Write a fastlane lane that builds the Android bundle and uploads it to the internal testing track. Read the signing details from environment variables and tell me their names.”
  • “List every secret this workflow needs and where each is used. Do not ask me for their values.”

Start small

Get the check workflow green first. Add Android delivery next, and iOS last, since it has the most moving parts. A pipeline you understand beats one you copied.

Where MobileKit fits

The pack’s release-build skill signs, builds and uploads to the stores’ test tracks, writes a record of versions and where each build went, and stops before any public release. The same discipline applies to a CI pipeline. See Build a Flutter app with Claude Code.

Sources read on the day this post was written: Flutter: continuous delivery, GitHub-hosted runners, GitHub: using secrets in Actions, fastlane upload_to_testflight and fastlane upload_to_play_store.

Questions

What CI/CD options does Flutter document?

Flutter's documentation lists all-in-one options with built-in Flutter support, such as Codemagic, Bitrise and Appcircle, and integrating fastlane with existing workflows, including GitHub Actions, Cirrus, Travis, GitLab and CircleCI.

Should I automate store submission?

Automate building and uploading to test tracks. Keep a person's approval in front of anything that makes a build public, because that decision has consequences you cannot undo quickly.

Where should signing keys live?

Outside the repository, in your CI provider's secret store. GitHub documents secrets for Actions workflows. Never commit key files or passwords.

Try it on your next idea

One payment, every update to this major version, and a refund window if it is not for you. Refund policy.