rn-ci-setup is a production-focused CLI to automate React Native CI/CD setup with GitHub Actions, Fastlane, signing, and GitHub Secrets management.
It is designed for teams that want a guided, repeatable setup flow with minimal manual file creation.
npm i -g rn-ci-setupor run without global install:
npx rn-ci-setup initWhen you run init, the CLI orchestrates the full setup pipeline:
- Validates Git repository state and bootstrap behavior
- Creates GitHub repo with
ghwhenoriginis missing - Lets you choose the working branch and syncs it
- Collects platform and template options
- Configures optional Slack/Discord/Teams notifications
- Generates GitHub workflows and Fastlane files
- Runs Bundler setup
- Runs interactive Fastlane setup commands
- Configures GitHub Actions secrets via
gh - Commits and pushes generated files (unless skipped)
npx rn-ci-setup initCommon flags:
--ci-provider <github|bitrise|codemagic>: choose CI provider (default:github)--android/--ios: target platforms--expo/--bare: project template--notify-slack: enable Slack notification integration--notify-discord: enable Discord notification integration--notify-teams: enable Microsoft Teams notification integration--app-path <path>: target app path for monorepos--skip-bundle: skipbundle install--skip-fastlane: skip Fastlane initialization/signing commands--skip-secrets: skip GitHub secrets setup--skip-push: skip commit/push stage
Examples:
npx rn-ci-setup init --ci-provider github --android --ios
npx rn-ci-setup init --ci-provider bitrise --android --ios
npx rn-ci-setup init --ci-provider codemagic --ios --app-path apps/mobile
npx rn-ci-setup init --ios --app-path apps/mobile
npx rn-ci-setup init --android --ios --notify-slack --notify-teams
npx rn-ci-setup init --android --ios --skip-fastlane --skip-secretsCreates or updates required GitHub Actions secrets using GitHub CLI:
npx rn-ci-setup secretsOptional repo override:
npx rn-ci-setup secrets --repo owner/repoPrints a guided checklist to generate platform API keys and map them to the expected GitHub Actions secrets.
npx rn-ci-setup keysPlatform-scoped usage:
npx rn-ci-setup keys --ios
npx rn-ci-setup keys --android
npx rn-ci-setup keys --ios --androidChecks required CI/CD values and warns on missing or weak placeholders:
npx rn-ci-setup doctorDepending on selected targets, init generates:
.github/workflows/android.yml(GitHub provider).github/workflows/ios.yml(GitHub provider)bitrise.yml(Bitrise provider)codemagic.yaml(Codemagic provider)Gemfile(ensures Fastlane dependency)ios/fastlane/Fastfileios/fastlane/Appfileios/fastlane/Matchfileandroid/fastlane/Fastfile.rn-ci-setup.json
- GitHub: full automation path, including GitHub Actions secrets via
gh. - Bitrise: generates
bitrise.ymland Fastlane files; secrets must be added in Bitrise dashboard. - Codemagic: generates
codemagic.yamland Fastlane files; secrets must be added in Codemagic dashboard.
For Bitrise/Codemagic projects, --skip-secrets is effectively implied because GitHub secret automation is not used.
For iOS, the CLI supports this setup flow:
cd ios && bundle exec fastlane init(if missing)cd ios && bundle exec fastlane match init(if needed)cd ios && bundle exec fastlane match appstorecd ios && bundle exec fastlane match development
For Android, the CLI initializes Fastlane when needed:
cd android && bundle exec fastlane init
Generated workflows follow this model:
pull_requesttomain/master: run CI lanespushtomain/master: run beta/distribution lanesworkflow_dispatch: manual release lanes
APP_STORE_CONNECT_KEY_IDAPP_STORE_CONNECT_ISSUER_IDAPP_STORE_CONNECT_PRIVATE_KEYMATCH_GIT_URLMATCH_PASSWORDAPPLE_APP_IDENTIFIERAPPLE_TEAM_ID
Recommended:
APP_STORE_CONNECT_TEAM_IDFASTLANE_USER
ANDROID_KEYSTORE_BASE64ANDROID_KEYSTORE_PASSWORDANDROID_KEY_ALIASANDROID_KEY_PASSWORD
SLACK_WEBHOOK_URLDISCORD_WEBHOOK_URLTEAMS_WEBHOOK_URL
You can print this guide anytime from CLI:
npx rn-ci-setup keys --ios --android- Open App Store Connect -> Users and Access -> Integrations -> App Store Connect API.
- Generate a key and download the
.p8file. - Capture:
- Key ID
- Issuer ID
- Full
.p8key content
- Add these secrets:
APP_STORE_CONNECT_KEY_IDAPP_STORE_CONNECT_ISSUER_IDAPP_STORE_CONNECT_PRIVATE_KEY
- Ensure iOS signing secrets are also configured:
MATCH_GIT_URLMATCH_PASSWORDAPPLE_APP_IDENTIFIERAPPLE_TEAM_ID
- Open Google Play Console -> Setup -> API access.
- Link a Google Cloud project.
- Create a service account in Google Cloud IAM.
- Grant required Play Console permissions to that service account.
- Create and download the service account JSON key.
- If your Android release lanes need base64:
base64 -i play-service-account.json | tr -d '\n'- Configure Android signing secrets:
ANDROID_KEYSTORE_BASE64ANDROID_KEYSTORE_PASSWORDANDROID_KEY_ALIASANDROID_KEY_PASSWORD
- Node.js and npm
- Git
- GitHub CLI (
gh) authenticated - Ruby and Bundler
- Xcode/CocoaPods for iOS pipelines
- Android toolchain for Android pipelines
npm install
node ./bin/index.js --help
node ./bin/index.js init
node ./bin/index.js secrets
node ./bin/index.js doctornpm version patch
npm publishUse minor or major version bumps when appropriate.