Debug build
Workflow that builds the app in debug mode for Android and iOS.
This workflow can be triggered by other workflows depending on it.
Additionally, Debug build workflow is triggered every time new code is pushed to main
branch
for caching purposes. This way, every branch will be able to use the cached build. More information about cache scoping can be found here:
GitHub Docs: Matching a cache key.
Usage
This workflow cannot be explicitly specified to be generated using SCI. It will be generated automatically if you choose to create workflow depending on it.
Detailed behavior
Below you can find detailed information about what the script does with your project when generating Debug Build workflow.
Fingerprint
This workflow takes advantage from the fact that debug builds need to be remade only if native code changes.
It uses @expo/fingerprint to generate a hash string of your native code (called fingerprint) to cache debug builds and create new builds only if necessary.
This logic is extracted to auxiliary reusable workflow lookup-cached-debug-build
. You can find more
information about it here: Lookup cached debug build.
Caching
Built apps will be cached using actions/cache using keys
android-debug-build-${{ android-fingerprint }}
and
ios-debug-build-${{ ios-fingerprint }}
(fingerprints for Android and iOS apps are different).
Note that this save a significant amount of time and resources, since changes in native code are relatively rare when developing a React Native app.
Modified and created files
File | Changes |
---|---|
.github/workflows/build-debug-android.yml | Contains the CI workflow for building debug Android app |
.github/workflows/build-debug-ios.yml | Contains the CI workflow for building debug iOS app |
package.json |
|
app.json | Fields expo.android.package and expo.ios.bundleIdentifier will be created in Expo projects if not detected (they are needed for npx expo prebuild ) |
Workflow details
build-debug-android
The following diagram represents the flow of the build-debug-android
workflow:
build-debug-ios
The following diagram represents the flow of the build-debug-ios
workflow:
Known issues and limitations
- One of limitations of GitHub Actions is that cache is scoped and cannot be accessed between
arbitrary branches (see #79). This means that
if a build with specific fingerprint is created on
feature-a
branch, then infeature-b
branch with the same fingerprint, the build is not visible and the app will be built again. However, since the build is also created on main branch, once eitherfeature-a
orfeature-b
is merged to main, the build will be cached and available for all existing and future branches in the repository.