Skip to content

Commit

Permalink
add android workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
RoepStoep committed Sep 14, 2023
1 parent 754bdb8 commit b634a4d
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 2 deletions.
55 changes: 55 additions & 0 deletions .github/actions/build-lidrobile-apk/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-action.json
name: Lidrobile APK
description: Build a Debug APK of Lidrobile Android app

inputs:
artifactName:
description: "The name of the output artifact for the APK."
required: false
default: "debugApk"
patchNonFree:
description: "Whether nonfree dependencies should be patched out."
required: false
default: "false"

runs:
using: "composite"
steps:
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
- name: Install Dependencies
shell: bash
run: npm ci
- name: Patch nonfree
if: inputs.patchNonFree == 'true'
env:
PATCH_NONFREE_FORCE: "1"
shell: bash
run: |
npm run patch-nonfree
git diff
- name: Build web
shell: bash
run: npm run build
- name: Setup JDK
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Sync android capacitor
shell: bash
run: npx cap update android
- name: Build APKs
working-directory: ./android
shell: bash
run: |
./gradlew assembleDebug
- uses: actions/upload-artifact@v2
with:
name: ${{ inputs.artifactName }}
path: |
./android/app/build/outputs/apk/debug/
36 changes: 36 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Android build

on:
workflow_dispatch:
push:
paths:
- '.github/workflows/android.yml'
- '.github/actions/build-lidrobile-apk.yml'
- 'android/**'
branches-ignore:
- 'l10n_master'

jobs:
apk:
name: Generate debug APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/build-lidrobile-apk

freeApk:
name: Generate free debug APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/build-lidrobile-apk
with:
artifactName: "debugFreeApk"
patchNonFree: "true"
- name: Check non-free dependencies
working-directory: ./android/app/build/outputs/apk/debug/
run: |
dexdump=$(find $ANDROID_HOME/build-tools/ -name 'dexdump' | sort -r | head -1)
! $dexdump app-debug.apk | grep 'Class descriptor' | grep com\/google\/firebase
! $dexdump app-debug.apk | grep 'Class descriptor' | grep com\/google\/android\/gms
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android:
- extra-android-m2repository
sudo: false
before_install:
- nvm install 14.17
- nvm install 16
- echo y | sdkmanager "ndk-bundle"
install:
- npm install
Expand All @@ -23,7 +23,7 @@ before_script:
script:
- npm run lint
- npm run test
- cd android && ./gradlew assembleWithoutNNUEDebug
- cd android && ./gradlew assembleDebug
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
Expand Down

0 comments on commit b634a4d

Please sign in to comment.