Flutter, fastlane, macOS, CI/CD: introduction.

Introduction to my CI/CD pipeline for Flutter apps. Desktop for macOS/Windows included.

February 9, 2023 2 min read

#flutter
#fastlane
#macos
#ci/cd

Introduction

As part of development pipeline for new GUI client application for Prezentor, I tried to set up CI/CD solution. Keeping in mind fact our software should work on macOS/iOS/Windows I started with codemagic.io service. It was fine for a while until I migrated to monorepo. Due to some configuration issues at codemagic I gave up and decided to build my own CI/CD pipeline with gitlab.

Goals:

  • Build different apps (cross-platform full-featured software and web-based reporting).
  • Generate shared code coverage across monorepo.
  • Generate static code analysis report across mono repo.
  • Deploy application(s) to TestFlight, Windows Store, Play Market and static host automatically.
  • Streamline testing and debugging on real devices.

Tools

Fastlane

Fastlane has perfect documentation and rich toolset. However it's mostly focused on iOS/Android. Mine main focus was on Desktop version for Mac (and Windows later in the process).

Melos

One and only monorepo manager for Flutter. It's not perfect but it's the only one that works.

Lefthook

To make sure code is formatted/tested before commit.

GitLab (self-hosted in my case)

Historically we used self-hosted GitLab so we kind of have no choice here. 2 MacMinis (M1 and x86) with gitlab-runner will do the job.

UPD: Part 2 - build and deploy flutter desktop app for macOS.

Comments