Created
February 2, 2021 19:16
-
-
Save ryanhanwu/0532c50f91c77388043a3c0cf85d46b8 to your computer and use it in GitHub Desktop.
Build React Native Android App and submit to Firebase App Distribution via Github Actions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Android CI | |
on: | |
push: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: macOS-latest | |
steps: | |
- name: Checkout Source Code | |
uses: actions/checkout@v2 | |
- name: Generate keys from Secrets | |
env: | |
# Service Account Key JSON file https://docs.fastlane.tools/actions/supply/#setup | |
FIREBASE_ANDROID_JSON: ${{secrets.FIREBASE_ANDROID_JSON}} | |
run: | | |
echo "$FIREBASE_ANDROID_JSON" >> android/firebase-app-distribution.json | |
- name: Setup Node.js 12 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '12' | |
- name: Install React Native Project dependencies | |
run: | | |
yarn | |
- name: Build Android Project | |
run: | | |
curl https://raw.githubusercontent.com/facebook/react-native/master/template/android/app/debug.keystore > android/app/debug.keystore | |
cd android && ./gradlew clean && ./gradlew build --refresh-dependencies | |
- name: Setup Ruby 2.7 | |
uses: actions/setup-ruby@v1 | |
with: | |
ruby-version: '2.7' | |
- name: Install Fastlane | |
run: | | |
bundle install | |
- name: Run Fastlane | |
uses: maierj/[email protected] | |
with: | |
lane: 'beta_ci' | |
subdirectory: 'android' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default_platform(:android) | |
platform :android do | |
desc "Deploy a new version to the Firebase App Distribution" | |
lane :beta_ci do | |
gradle(task: "clean assembleRelease") | |
firebase_app_distribution( | |
app: "1:123123123123123123123", #https://console.firebase.google.com/u/2/project/ | |
service_credentials_file: "./firebase-app-distribution.json", # Created from android_workflow.yml steps | |
groups: "qa-team" | |
) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "https://rubygems.org" | |
gem "fastlane" | |
plugins_path = File.join(File.dirname(__FILE__), 'Pluginfile') | |
eval_gemfile(plugins_path) if File.exist?(plugins_path) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'fastlane-plugin-firebase_app_distribution' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment