53 lines
1.8 KiB
YAML
53 lines
1.8 KiB
YAML
name: Create-Apk-QA
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
environment:
|
|
description: Choose build environment
|
|
required: true
|
|
type: choice
|
|
options:
|
|
- qa
|
|
- dev
|
|
jobs:
|
|
generate:
|
|
runs-on: [ default ]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
token: ${{ secrets.MY_REPO_PAT }}
|
|
submodules: recursive
|
|
- name: Set Node.js 16.x
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 16.x
|
|
- name: Install yarn
|
|
run: npm install --global yarn
|
|
- name: Install dependency
|
|
run: yarn
|
|
- name: Set up JDK 11
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
java-version: 11
|
|
distribution: adopt
|
|
- name: Setup Android SDK
|
|
uses: android-actions/setup-android@v2
|
|
- name: Grant execute permission for gradlew
|
|
run: chmod +x android/gradlew
|
|
- name: Create local.properties
|
|
run: cd android && touch local.properties && echo "sdk.dir = /home/USERNAME/Android/Sdk" > local.properties
|
|
- name: Assemble with Stacktrace - QA Release
|
|
if: (github.event.inputs.environment == 'qa' || inputs.environment == 'qa')
|
|
run: yarn move:qa && yarn debug && cd android && ./gradlew assembleDebug
|
|
- name: Assemble with Stacktrace - Dev Release
|
|
if: (github.event.inputs.environment == 'dev' || inputs.environment == 'dev')
|
|
run: yarn move:dev && yarn debug && cd android && ./gradlew assembleDebug
|
|
- name: Upload APK as Artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: app-${{ github.event.inputs.type || inputs.type }}
|
|
path: android/app/build/outputs/apk/${{ github.event.inputs.type || inputs.type }}/
|
|
retention-days: 30
|