← Back to index

React Native Template

Test, build, and distribute React Native apps for iOS and Android (beta and release).

Note: This template requires a macOS runner for iOS builds. Android builds can run on Linux runners.

Setup

Recommended: External CI/CD Configuration

Go to Settings > CI/CD > General pipelines and set CI/CD configuration file to:

https://gitlab-ci-yaml-template.enouvo.com/react-native/.gitlab-ci.yml

Alternative: Include in .gitlab-ci.yml

include:
  - 'https://gitlab-ci-yaml-template.enouvo.com/react-native/.gitlab-ci.yml'

Required Variables

VariableDescription
GITLAB_CI_ACCESS_TOKENToken to download ci-scripts (set by admin at group level)
MATCH_GIT_URLGit URL for fastlane match certificates repo
MATCH_PASSWORDPassword for match certificates
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORDApple app-specific password for uploads

Optional Variables

VariableDefaultDescription
NODE_VERSION14.19.1Node.js version
YARN_CACHE_FOLDER~/.yarncache/...Yarn cache directory

Pipeline Stages

testbuildnotify

Build Jobs

JobBranchDescription
build_ios_betadev, stagingBuild iOS beta via TestFlight
build_android_betadev, stagingBuild Android beta APK/AAB
build_ios_releasereleaseBuild iOS release for App Store
build_android_releasereleaseBuild Android release for Play Store

Skip Variables

SKIP_TEST=true
SKIP_IOS_BUILD=true
SKIP_ANDROID_BUILD=true

Project Structure

react-native-app/
├── ios/
│   ├── fastlane/
│   │   ├── Fastfile
│   │   └── Matchfile
│   └── ...
├── android/
│   ├── fastlane/
│   │   └── Fastfile
│   └── ...
├── package.json
└── .gitlab-ci.yml