Files
App/.github/workflows/build-android.yml
Brys 9d2e10e996 Switch from Yarn/Node.js to bun for faster dev install (#704)
* refactor: change from yarn to bun for package management

* feat: change workflows all to bun instead of node/yarn.

* refactor: change from node repl to bun repl

* fix: re-add nodejs as an applicable engine to package.json

* fix: remove bun.lock from hash in android-build workflow

---------

Co-authored-by: Ritesh Shukla <riteshshukla2381@gmail.com>
2025-11-23 17:31:24 -06:00

79 lines
2.2 KiB
YAML

name: Build Android APK
on:
pull_request:
paths:
- '.github/workflows/build-android.yml'
- 'android/**'
- 'package.json'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-android:
runs-on: macos-15
steps:
- name: 🛒 Checkout
uses: actions/checkout@v4
- name: 🖥 Setup Bun 1.3.2
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.2
- name: 💎 Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0' # Match your local Ruby version
bundler-cache: true
- name: 💬 Echo package.json version to Github ENV
run: echo VERSION_NUMBER=$(bun -p "require('./package.json').version") >> $GITHUB_ENV
- name: 🔑 Decode and setup release keystore
continue-on-error: true
run: |
if [ -n "${{ secrets.ANDROID_SIGNING_BASE64 }}" ]; then
echo "${{ secrets.ANDROID_SIGNING_BASE64 }}" | base64 --decode > android/app/jellify.keystore
echo "Release keystore created"
else
echo "No keystore secret found, will use debug keystore"
fi
- uses: actions/cache@v3
with:
path: |
node_modules
~/.gradle/caches
~/.gradle/wrapper
~/.cache/turbo
android/.gradle
android/app/build
key: ${{ runner.os }}-gradle-turbo-${{ hashFiles('**/build.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-turbo-
- name: 🤖 Run bun init-android
run: bun i
- name: 🚀 Run turbo build
run: bun android-build
env:
KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
- name: 📦 Upload APK for testing
uses: actions/upload-artifact@v4
if: always()
with:
name: jellify-android-pr-${{ github.event.number }}-${{ env.VERSION_NUMBER }}
path: |
android/app/build/outputs/apk/release/*.apk
retention-days: 7
if-no-files-found: warn