Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/build-apk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build Example APK

on:
workflow_dispatch:
push:
branches: [main, master]
pull_request:
branches: [main, master]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-example-apk:
name: Build Example APK
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actions/setup-node npm caching will only consider the default lockfile path (root package-lock.json). Since this workflow also runs npm ci in example/, add cache-dependency-path including example/package-lock.json so the example install can benefit from the npm cache as well and avoid slower CI runs.

Suggested change
cache: 'npm'
cache: 'npm'
cache-dependency-path: |
package-lock.json
example/package-lock.json

Copilot uses AI. Check for mistakes.

- name: Setup Java JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Install dependencies
run: npm install --legacy-peer-deps

- name: Build library
run: npm run build

- name: Install example dependencies
working-directory: example
run: npm ci --legacy-peer-deps

- name: Build release APK
working-directory: example/android
run: ./gradlew assembleRelease --no-daemon --stacktrace

- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: example-apk
path: example/android/app/build/outputs/apk/release/app-release.apk
retention-days: 30
Comment on lines +17 to +64
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow largely duplicates the Android build steps already present in .github/workflows/ci.yml (Node/Java setup, Gradle cache, root build, example install, Gradle assemble). Consider extracting the common logic into a reusable workflow (workflow_call) or a composite action so debug/release builds don’t drift over time and CI maintenance stays centralized.

Suggested change
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Setup Java JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Install dependencies
run: npm install --legacy-peer-deps
- name: Build library
run: npm run build
- name: Install example dependencies
working-directory: example
run: npm ci --legacy-peer-deps
- name: Build release APK
working-directory: example/android
run: ./gradlew assembleRelease --no-daemon --stacktrace
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: example-apk
path: example/android/app/build/outputs/apk/release/app-release.apk
retention-days: 30
uses: ./.github/workflows/ci.yml
secrets: inherit

Copilot uses AI. Check for mistakes.
Loading