Skip to main content

CI/CD Pipeline

A Continuous Integration and Continuous Deployment (CI/CD) pipeline is an automated process for continuous integration and continuous delivery/deployment, utilizing tools like Codemagic, which streamlines software development by automating testing, building, and deployment tasks, with specific workflows designed for different branches at various stages of development.

Test Workflow

The workflow is named Test Workflow and specifies a configuration for automates the testing process for mobile app development, ensuring code quality and reliability before deployment.

The workflow is triggered by pull request events on branches matching the pattern release/*. Previous builds are canceled when a new build is triggered.

The workflow consists of several scripts:

  1. Check Target Branch: This script checks if the target branch of the pull request is dev and skips the build if it is.
  2. Get Dependencies: Fetches project dependencies using Flutter and Dart package manager.
  3. Check Dependencies Health: Checks the health of dependencies using Flutter Doctor and a custom tool called Patrol.
  4. Set Up Keystore: Decodes and sets up the keystore required for signing the app.
  5. Run Unit Test: Clones a GitLab repository, installs dependencies and runs unit tests using Flutter.
  6. Run Integration Test: Builds the app for production, runs integration tests using Flutter's Patrol tool, and executes instrumented tests on Firebase Test Lab.

Deployment Workflows

Android Production Deployment Workflow

The workflow is named Android Production Deployment Workflows automates the deployment of the Android app to production. It is triggered by tag events on the master branch and cancels previous builds to ensure only the latest changes are deployed. The workflow consists of several scripts:

  1. Get Dependencies: Fetches project dependencies using Flutter package manager.
  2. Set Up Keystore: Decodes and sets up the keystore required for signing the app.
  3. Build AAB: Builds the Android App Bundle (AAB) for production using Flutter, specifying the main production entry point.

After the build is completed, the generated AAB artifact is published to the Google Play Store production track using Google Play credentials provided in the workflow configuration.

Additionally, this deployment workflow is configured to automatically submit the newly uploaded AAB for review on the Google Play Store. Once the review process is completed successfully, the app release is automatically triggered, ensuring seamless delivery of updates to end-users.

iOS Production Deployment Workflow

Named iOS Production Deployment Workflows, configuration streamlines the deployment of iOS apps to the App Store. Triggered by tag events on the master branch, it cancels previous builds to ensure only the latest changes are processed.

The workflow integrates with App Store Connect via Codemagic API Key for streamlined App Store deployment. Key script steps include:

  1. Installing Pods: Installs CocoaPods dependencies for iOS projects.
  2. Building the IPA: Generates the iOS app as an IPA package for App Store distribution, with incremented build numbers and specified export options.

Upon completion, the IPA artifact is published to App Store Connect. The workflow automatically submits the app for review, and upon successful completion of the review process, triggers the app release, ensuring smooth and timely delivery of updates to users.

Hotfix Deployment Workflows

Android Hotfix Deployment Workflow

The Android Hotfix Deployment Workflows automate the OTA (Over-The-Air) deployment of critical fixes to Android apps. This workflow is initiated by tag events on the master branch that include the prefix +hotfix. Key script steps include:

  1. Get Flutter Dependencies: Fetches project dependencies using the Flutter package manager.
  2. Set Up Keystore: Decodes and sets up the keystore required for signing the app.
  3. Shorebird Install Scripts: Installs and sets up Shorebird tools in the environment to enable OTA features.
  4. Extract App Version Scripts: Obtains the app project's version, including the semantic version and build number.
  5. Shorebird Build Patch:
    • Builds the appbundle artifacts for the Android update.
    • Downloads the corresponding release artifacts based on the version obtained from the Extract App Version Scripts step.
    • Generates a patch by calculating the diff between the release and the current changes.
    • Uploads the patch artifacts to the Shorebird backend.
    • Promotes the patch to the stable channel.

iOS Hotfix Deployment Workflows

The iOS Hotfix Deployment Workflows facilitate the OTA (Over-The-Air) deployment of urgent bug fixes to iOS apps. This workflow is triggered by tag events on the master branch that include the prefix +hotfix. Key script steps include:

  1. Set Up Code Signing Settings on Xcode Project: Configures code signing settings on the Xcode project for App Store distribution.
  2. Get Flutter Dependencies: Retrieves project dependencies using the Flutter package manager.
  3. Install iOS Dependencies: Installs CocoaPods dependencies for iOS projects.
  4. Shorebird Install Scripts: Installs and sets up Shorebird tools in the environment to enable OTA features.
  5. Extract App Version Scripts: Obtains the app project's version, including the semantic version and build number.
  6. Shorebird Build Patch:
    • Builds the ipa artifacts for the iOS update.
    • Downloads the corresponding release artifacts based on the version obtained from the Extract App Version Scripts step.
    • Generates a patch by calculating the diff between the release and the current changes.
    • Uploads the patch artifacts to the Shorebird backend.
    • Promotes the patch to the stable channel.

Writer: Kai
Editor: Media
Created: 25 April 2024
Updated: 25 Mei 2024

DateDescriptionContributorChecked
25 Mei 2024Add hotfix deployment flows (Android & IOS)Kai
25 April 2024Document createdKai