Skip to content

Merge pull request #21 from wildlifeai/new-board #51

Merge pull request #21 from wildlifeai/new-board

Merge pull request #21 from wildlifeai/new-board #51

Workflow file for this run

name: Build and Deploy to App Distribution
on:
workflow_dispatch:
push:
tags:
- "*"
jobs:
# ios-build:
# environment: development
# name: iOS development build
# runs-on: [self-hosted, 'macOS']
# steps:
# - name: Cancel previous runs
# uses: styfle/cancel-workflow-action@0.12.0
# - name: Checkout repo from dev branch
# uses: actions/checkout@v3
# - name: create-json
# id: add-firebase-credentials
# uses: jsdaniell/create-json@v1.2.2
# with:
# name: 'wildlife-watcher-service-account.json'
# json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_JSON }}
# dir: './fastlane'
# - name: Copy Provisioning certificate
# run: echo -n "${{ secrets.IOS_CERT_PROVISION }}" | base64 --decode > ./fastlane/profile.mobileprovision
# - name: Copy private key
# run: echo -n "${{ secrets.IOS_CERT_PRIVATE_KEY }}" | base64 --decode > ./fastlane/cert.p12
# - name: Copy Google Services plist file
# run: echo -n "${{ secrets.IOS_GOOGLE_SERVICES_PLIST }}" | base64 --decode > ./ios/GoogleService-Info.plist
# - name: Install npm dependency
# run: npm install
# - name: Install bundler
# run: gem install bundler -v 2.4.10
# - name: Install gem plugins
# run: bundle install
# - name: Cache cocoapods
# uses: actions/cache@v3
# with:
# path: ./ios/Pods
# key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
# restore-keys: |
# ${{ runner.os }}-pods-
# - name: Install dependencies with CocoaPods
# run: cd ios && bundle exec pod install && cd ..
# - name: Run fastlane
# run: bundle exec fastlane ios build_debug
# env:
# IOS_CERT_PASSWORD: ${{ secrets.IOS_CERT_PASSWORD }}
android-build:
environment: development
name: Android development build
runs-on: ubuntu-latest
container:
image: reactnativecommunity/react-native-android
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.12.0
- name: Checkout repo from dev branch
uses: actions/checkout@v3
- name: create-json
id: add-firebase-credentials
uses: jsdaniell/create-json@v1.2.2
with:
name: "wildlife-watcher-service-account.json"
json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_JSON }}
dir: "./fastlane"
- name: create-json
id: add-android-credentials
uses: jsdaniell/create-json@v1.2.2
with:
name: "google-services.json"
json: ${{ secrets.ANDROID_GOOGLE_SERVICES_JSON }}
dir: "./android/app"
- name: Copy keystore file
run: echo -n "${{ secrets.ANDROID_RELEASE_KEYSTORE }}" | base64 --decode > ./android/keystores/release.keystore
- name: Copy keystore properties file
run: echo -n "${{ secrets.ANDROID_RELEASE_KEYSTORE_PROPS }}" | base64 --decode > ./android/keystores/release.keystore.properties
- name: Install npm dependency
run: npm install
- name: Install bundler
run: |
gem install bundler -v 2.4.10
- name: Install gem plugins
run: |
bundle install
# - uses: actions/cache@v3
# with:
# path: |
# ./android/.gradle/caches
# ./android/.gradle/wrapper
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
# restore-keys: |
# ${{ runner.os }}-gradle-
- name: Run fastlane
run: |
echo ${{ github.run_number }}
bundle exec fastlane android build_release
env:
APP_VERSION: ${{ github.event.release.tag_name }}
APP_CODE_VERSION: ${{ github.run_number }}
APP_ID: ${{ secrets.APP_ID }}
ANDROID_ARTEFACT_PATH: ${{ secrets.ANDROID_ARTEFACT_PATH }}
TESTERS: ${{ vars.TESTERS }}