Skip to content

Issue #SB-000 chore: Updted android.yml. #5

Issue #SB-000 chore: Updted android.yml.

Issue #SB-000 chore: Updted android.yml. #5

Workflow file for this run

name: Android
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
jobs:
build:
environment: sunbird
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'zulu'
cache: gradle
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Install Ionic
run: npm install -g @ionic/cli
- name: Install app dependencies
run: npm install
- name: Convert Windows line endings to Linux from the gradlew file
run: sudo apt update && sudo apt install dos2unix && cd android && dos2unix ./gradlew && cd ..
- name: Make ./gradlew command executable
run: cd android && chmod +x ./gradlew && cd ..
- name: Decode google-service
id: decode_google-service
uses: timheuer/[email protected]
with:
fileName: 'google-services.json'
fileDir: '/home/runner/work/SunbirdEd-mobile-app/SunbirdEd-mobile-app/configurations/'
encodedString: ${{ secrets.GOOGLE_SERVICE_CONTENT }}
- name: Decode env file
id: decode_env
uses: timheuer/[email protected]
with:
fileName: 'configuration.prod.ts'
fileDir: '/home/runner/work/SunbirdEd-mobile-app/SunbirdEd-mobile-app/configurations/'
encodedString: ${{ secrets.ENV }}
- name: Decode Keystore
id: decode_keystore
uses: timheuer/[email protected]
with:
fileName: 'android_keystore.jks'
fileDir: '/home/runner/work/SunbirdEd-mobile-app/SunbirdEd-mobile-app/android/app/keystore/'
encodedString: ${{ secrets.KEYSTORE }}
- name: Build Ionic assets
run: ionic build --prod && npx cap sync
- name: Build bundle
run: cd android && ./gradlew app:bundleRelease
env:
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
- name: Build APK
run: cd android && ./gradlew assembleDebug
- name: Install Firebase tools
run: npm i -g [email protected]
- name: Deploy to firebase
run: cd android/app/build/outputs/bundle/release && firebase appdistribution:distribute sunbird-6.0.local-release.aab \
--token ${{ secrets.FIREBASE_TOKEN }} \
--app ${{ secrets.FIRBASE_APP_ID }} \
--groups developer
- name: Upload APK
uses: actions/[email protected]
with:
name: app-release
path: ${{ github.workspace }}/android/app/build/outputs/