Build Ionic framework App Source and Artifact Android Apk Action

Build Ionic framework App Source and Artifact Android Apk Action


My Workflow This GitHub Action “Get Android Apk” is designed to automate the developers work to:

Configure the Java,Node.js,Ionic cli Build from latest Ionic Source and make android source Then Build the Android app from latest Source Upload The build to the the Artifact for Testing on every changes done in master branch

Submission Category:

  • Maintainer Must-Haves, DIY Deployments Yaml File or Link to Code name: Get Android APK
on: [push, pull_request]

jobs:
  build:
    name: Build APK
    runs-on: ubuntu-latest
    steps:
      - name: checkout source
        uses: actions/checkout@v2

      - name: setup java sdk
        uses: actions/setup-java@v1
        with:
          java-version: '9.0.4'

      - name: setup Node.js
        uses: actions/setup-node@v1
        with:
          node-version: 13.x

      - name: Install Cordova
        run: npm install -g cordova

      - name: Install Ionic cli
        run: npm install -g @ionic/cli

      - name: Install app dependencies
        run: npm install

      - name: build the app
        run: npm run build

      - name: remove existing folder if there 
        run: rm -rf {path of your android folder dir.} # eg. /home/runner/work/Bookie/Bookie/android

      - name: Add to android
        run: npx cap add android

      - name: sync with source
        run: npx cap sync

      - name: Generate the Android App Apk
        working-directory: {working android directory} # eg. /home/runner/work/Bookie/Bookie/android 
        run: bash ./gradlew assembleDebug --stacktrace

      - name: Upload dev APK
        uses: actions/upload-artifact@v1
        with:
          name: app-dev
          path: android/app/build/outputs/apk/debug/app-debug.apk
© 2024 Harsh Pal