Skip to content

Example of setup Github actions build config for react native project

Notifications You must be signed in to change notification settings

puneetkansal04/react-native-ci

 
 

Repository files navigation

Build iOS adhoc Build Android adhoc Test adhoc

Github Actions

Automation of your project is important! In this repository you can find React native example project of CI configuration using Github actions.

This is a simple project that was generated by React native CLI

How to configure

Build steps Github actions are located in following structure:

.github
   workflow
       android_adhoc.yml
       ios_adhoc.yml
       test_adhoc.yml
  • android_adhoc.yml - Configuration for running android build, increasing build number and upload to Firebase distribution.
  • ios_adhoc.yml - Configuration for running ios build, increasing build number and upload to Firebase distribution.
  • test_adhoc.yml - Executing lint check and tests on every commit or PR on the main branch.

In order to sign your build and upload to Firebase distribution need to define Secrets in Github:

IOS provisioning

This article can help to generate and sign the provision on your apple developer account.

  • TEAM_ID - Your team id from (https://developer.apple.com/account/#/membership)
  • AD_HOC_MOBILEPROVISION_BASE64 - You can use this as example cat provisioning.mobileprovision | base64 > mobileprovision-base64.txt and cope the file content to the secret.
  • P12_BASE64 - You can use this as example cat Certificates.p12 | base64 > p12-base64.txt and cope the file content to the secret.
  • AD_HOC_CODE_SIGNING_IDENTITY - For example iOS Distribution

Android keystore

You can generate a new one or use existing one.

  • STAGING_KEYSTORE - Need to export it to base64, cat my-release-key.keystore | base64 > my-release-key-base64.txt and cope the file content to the secret.
  • STAGING_KEYSTORE_ALIAS - Alias name of the keystore.
  • STAGING_KEYSTORE_ALIAS_PASSPHRASE - Alias password of the keystore.
  • STAGING_KEYSTORE_PASSPHRASE - Keystore password.

###Firebase distribution I am using Firebase distribution in order to upload final builds of Android and IOS, you can follow this guid where to get the credentials.

  • FIREBASE_APP_ID_ANDROID
  • FIREBASE_APP_ID_IOS
  • FIREBASE_TOKEN - In order to get the token please run firebase login:ci, you may need to install Firebase CLI

Important note

  • For IOS sign, Need to cancel automatic manage sign and select the provisioning profile.
  • Github Actions has option to run on self hosted machine as you have limit of how many free runs you can do (For self hosted it is free and unlimited!)

About

Example of setup Github actions build config for react native project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 36.5%
  • Objective-C 26.1%
  • JavaScript 22.3%
  • Starlark 11.3%
  • Ruby 3.8%