Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

React Native Android Build & Publish

A GitHub composite action that automates building a React Native Android application and publishing it to the Google Play Store.

Usage

Create a workflow file (e.g., .github/workflows/deploy.yml) in your React Native project repository:

name: Deploy Android App

on:
  push:
    branches:
      - main # or your default branch

jobs:
  build-and-publish:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v4

      - name: Build and Publish App
        uses: georgechitechi/android-packager@v1
        with:
          # Required Inputs
          keystore-base64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
          keystore-password: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
          key-alias: ${{ secrets.ANDROID_KEY_ALIAS }}
          key-password: ${{ secrets.ANDROID_KEY_PASSWORD }}
          # Google Play Console (Optional if publish-to-play-store is true)
          # service-account-json: ${{ secrets.PLAY_CONSOLE_JSON }}
          # package-name: 'com.yourcompany.app'
          
          # Optional Inputs
          # publish-to-play-store: 'false'
          # save-to-releases: 'true'
          # working-directory: '.'
          # node-version: '24'
          # java-version: '21'
          # track: 'internal' # Options: internal, alpha, beta, production
          # build-type: 'aab' # Options: aab, apk

Inputs

Input Description Required Default
working-directory The directory where the React Native app is located No .
node-version Node.js version to use No 24
java-version Java version to use (e.g. 21) No 21
keystore-base64 Base64 encoded Android keystore Yes
keystore-password Password for the keystore Yes
key-alias Alias for the key Yes
key-password Password for the key Yes
service-account-json Google Play Console service account JSON No
package-name The Android application package name No
track The Google Play track (internal, alpha, beta, production) No internal
build-type Build type: aab or apk No aab
publish-to-play-store Whether to publish the app to Google Play Store No false
save-to-releases Whether to upload the build to GitHub Releases No true

Setup Instructions

  1. Keystore Base64: Generate a release keystore for Android and encode it to base64.

    base64 release.keystore > release.keystore.base64

    Copy the contents and add it as a GitHub Secret (ANDROID_KEYSTORE_BASE64).

  2. Google Play Service Account: Create a service account in your Google Cloud Console, give it permissions in Google Play Console, download the JSON key, and add the entire JSON file contents as a GitHub Secret (PLAY_CONSOLE_JSON).

  3. Other Secrets: Make sure to add ANDROID_KEYSTORE_PASSWORD, ANDROID_KEY_ALIAS, and ANDROID_KEY_PASSWORD as GitHub Secrets.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors