Skip to content

chore: update Node.js version to 24 in Android and iOS build workflows #599

chore: update Node.js version to 24 in Android and iOS build workflows

chore: update Node.js version to 24 in Android and iOS build workflows #599

name: Android Build Validation
on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- 'frontend/android/**'
- 'frontend/package.json'
- 'frontend/yarn.lock'
- '.github/workflows/android-build-validation.yml'
pull_request:
branches: [ main ]
paths:
- 'frontend/android/**'
- 'frontend/package.json'
- 'frontend/yarn.lock'
- '.github/workflows/android-build-validation.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build-android:
name: Build Android Debug
runs-on: ubuntu-latest
timeout-minutes: 35
defaults:
run:
working-directory: ./frontend
env:
CI: true
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Node & Cache Dependencies
uses: actions/setup-node@v6
with:
node-version: 24
- name: Enable Corepack
run: |
corepack enable
corepack prepare yarn@4.18.0 --activate
- name: Cache node_modules
uses: actions/cache@v4
with:
path: frontend/node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('frontend/yarn.lock') }}
- name: Cache Gradle Wrapper
uses: actions/cache@v4
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('frontend/android/gradle/wrapper/gradle-wrapper.properties') }}
- name: Cache Gradle Dependencies
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('frontend/android/**/*.gradle*', 'frontend/android/**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-caches-
- name: Setup Java
uses: actions/setup-java@v5.6.0
with:
distribution: 'zulu'
java-version: '17'
- name: Install JS Dependencies
run: yarn install --frozen-lockfile
- name: Grant Gradle Execute Permission
working-directory: ./frontend/android
run: chmod +x gradlew
- name: Inject google-services.json
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: |
node -e "
const fs = require('fs');
let content = process.env.GOOGLE_SERVICES_JSON;
if (!content || content.trim().length === 0) {
console.error('GOOGLE_SERVICES_JSON is empty!');
process.exit(1);
}
let parsed;
try {
parsed = JSON.parse(content);
} catch (e1) {
try {
const decoded = Buffer.from(content, 'base64').toString('utf8');
parsed = JSON.parse(decoded);
} catch (e2) {
console.error('CRITICAL ERROR: GOOGLE_SERVICES_JSON secret is corrupted.');
console.error('It is neither valid raw JSON nor valid Base64-encoded JSON.');
console.error('Raw JSON Error:', e1.message);
console.error('Base64 JSON Error:', e2.message);
console.error('Please re-copy your google-services.json file and update your GitHub Secret!');
process.exit(1);
}
}
fs.writeFileSync('android/app/google-services.json', JSON.stringify(parsed, null, 2));
"
- name: Compile Android Debug Build
working-directory: ./frontend/android
run: ./gradlew assembleDebug --console=plain
- name: Upload APK Artifact (On Failure)
if: failure()
uses: actions/upload-artifact@v4
with:
name: android-build-logs
path: |
~/.gradle/daemon/**/daemon-*.out.log
frontend/android/app/build/reports
if-no-files-found: ignore
retention-days: 7