Files
projet_gestion_commande/.github/workflows/frontend-client-build.yml
T
2026-03-06 17:16:24 +01:00

87 lines
2.5 KiB
YAML

name: Frontend Client - EAS Build
on:
push:
branches: [main]
paths:
- "mobile/**"
pull_request:
branches: [main]
paths:
- "mobile/**"
jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: mobile/package-lock.json
- name: Install dependencies
working-directory: mobile
run: npm ci
- name: Typecheck
working-directory: mobile
run: npx tsc --noEmit
build-apk-prod:
needs: typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: mobile/package-lock.json
- name: Setup Expo & EAS CLI
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: Install dependencies
working-directory: mobile
run: npm ci
- name: Inject EAS project ID
working-directory: mobile
run: |
jq '.expo.extra.eas.projectId = "${{ secrets.EXPO_PROJECT_ID_CLIENT }}"' app.json > app.tmp.json
mv app.tmp.json app.json
- name: Debug app.json
working-directory: mobile
run: cat app.json
- name: Build production APK
working-directory: mobile
env:
EAS_BUILD_NO_EXPO_GO_WARNING: true
run: eas build --platform android --profile production --non-interactive
- name: Download production APK
working-directory: mobile
run: |
APK_URL=$(eas build:list --platform android --status finished --limit 1 --json --non-interactive | jq -r '.[0].artifacts.buildUrl')
curl -L -o client-panel-prod.apk "$APK_URL"
- name: Upload production APK artifact
uses: actions/upload-artifact@v4
with:
name: client-panel-android-prod-apk
path: mobile/client-panel-prod.apk
retention-days: 14