Skip to content

Add CI workflow to build downloadable example APK#617

Merged
gre merged 1 commit intomasterfrom
ci/build-apk-artifact
Mar 29, 2026
Merged

Add CI workflow to build downloadable example APK#617
gre merged 1 commit intomasterfrom
ci/build-apk-artifact

Conversation

@gre
Copy link
Copy Markdown
Owner

@gre gre commented Mar 29, 2026

Summary

  • Add a new build-apk.yml GitHub Actions workflow that builds a release APK of the example app
  • The APK bundles JS, so it's standalone (no Metro needed) and easy to install on any Android device for testing
  • Triggered on push/PR to master and manually via workflow_dispatch
  • APK uploaded as artifact with 30-day retention

Test plan

  • CI workflow runs successfully
  • APK artifact is downloadable from the workflow run
  • APK installs and runs on an Android device

🤖 Generated with Claude Code

Separate workflow that builds a release APK (JS bundled, no Metro needed)
from the example app. Triggered on push, PR, and manually via workflow_dispatch.
The APK is uploaded as artifact with 30-day retention.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 29, 2026 12:17
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a dedicated GitHub Actions workflow to produce a downloadable Android APK for the example/ app, intended to simplify device testing by publishing a built artifact from CI.

Changes:

  • Introduce .github/workflows/build-apk.yml workflow triggered on push/PR to main/master and via workflow_dispatch.
  • Build the library + example app Android release APK and upload it as a CI artifact with 30-day retention.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.
Comment on lines +17 to +64
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
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.
@gre gre merged commit b098777 into master Mar 29, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants