This guide will walk through an opinionated development workflow with Shorebird.
Weβll cover how to automate releasing and patching with Shorebird to streamline
the entire development process so that you and your team can focus on shipping
high quality features to customers.
Prerequisites
This guide assumes you are already familiar with Shorebird and have integrated
it into your application. Refer to the getting started instructions for
more information. In addition, this guide also assumes that you are familiar
with GitHub Actions and
Git.
Overview
Shorebird provides a set of tools that you can use to push over the air updates
to your customers but itβs up to you to decide how to integrate it into your
development workflow.
While there are many ways to integrate Shorebird, the following workflow is a
common approach that we recommend:
The illustration above, uses trunk based
development and tags to trigger automated
release and patch workflows.
The workflow consists of three main phases:
Development: Developers work on features and bug fixes.
Release: When a feature is ready, a release is created and distributed to
customers (typically via stores).
Patch: If a critical bug is found, a patch is created and distributed to
customers immediately via Shorebird.
Letβs walk through each phase in more detail.
Development Phase
During this phase, developers are building features and fixing bugs.
The development workflow can be broken down into the following steps:
Create branch from trunk (main)
Work on task
Open a pull request to merge changes into trunk
Squash and merge after CI checks & code review.
We recommend squashing commits to keep the commit history clean and to make
it easier to cherry pick commits into release branches.
Note that with the described workflow, the trunk (e.g. main) is always in a
releasable state. This puts pressure on continuous integration (CI) checks to
ensure that the code on the trunk is always in a healthy, deployable state.
Checks that would typically run as part of the continuous integration process
include linting, formatting, unit tests, and integration tests. CI checks are
typically run on every pull request and must be passing before the pull request
can be merged.
You can refer to the following GitHub Actions workflow for an example.
Release Phase
When the team is ready to distribute a new version of the app, a release is
created. In some cases, releases are created on a regular cadence (e.g. weekly,
bi-weekly, monthly) while in other cases, releases are created on an ad-hoc
basis.
The release workflow can be broken down into the following steps:
Create a release branch (e.g release/v1.0.0) from trunk (main)
Create a new release on GitHub (e.g. v1.0.0).
This tags the commit so that we can easily find the commit in the future and
triggers the release workflow
The release workflow is triggered by the tag and generates signed artifacts
Distribute the artifacts (e.g. via AppStore, PlayStore, etc.)
You can refer to the following GitHub Actions workflow for an example.
When the release workflow has finished running, the artifacts are ready to be
distributed to customers via the appropriate channels.
Patch Phase
Even with great testing, sometimes bugs can creep into the app. Shorebird
allows you to fix these bugs and distribute the patches to customers devices
immediately rather having to wait for users to update.
The patch workflow can be broken down into the follow steps:
Fix the bug on the trunk branch using the development workflow described above.
Cherry pick the commit into the desired release branch(es)
Create a new βhotfixβ release on GitHub (e.g. v1.0.0-hotfix.1)
This tags the commit so that we can easily find the commit in the future and
triggers the patch workflow
The patch workflow is triggered by the tag and uploads the hotfix to the
staging environment
Preview the release in the staging environment using the Shorebird
CLI and validate the fix
You can refer to the following GitHub Actions workflow for an example.
When the patch workflow has finished running, the hotfix is ready to be
validated in Shorebirdβs staging environment and
promoted to production.
Recap
In this guide, we took a look at an opinionated development workflow with
Shorebird which allows teams to automate releasing and patching in order to
iterate quickly while still delivering a high quality experience to customers.