Android build #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Android build | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| apk: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 40 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4 | |
| - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: "3.12" | |
| - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v4 | |
| with: | |
| node-version: "20" | |
| - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4 | |
| with: | |
| distribution: temurin | |
| java-version: "17" | |
| - name: Generar sitio | |
| run: | | |
| python -m pip install PyYAML markdown | |
| python scripts/generate_site.py | |
| test -s site/classes/180.html | |
| - name: Preparar proyecto Capacitor | |
| working-directory: apps/android | |
| run: | | |
| mkdir -p www | |
| cp -r ../../site/* www/ | |
| npm install | |
| npx cap add android | |
| npx capacitor-assets generate --android | |
| npx cap sync android | |
| - name: Compilar APK | |
| working-directory: apps/android/android | |
| run: ./gradlew assembleDebug --no-daemon | |
| - name: Verificar contenido del APK (anti-vacio) | |
| run: | | |
| APK=apps/android/android/app/build/outputs/apk/debug/app-debug.apk | |
| test -s "$APK" | |
| COUNT=$(unzip -l "$APK" "assets/public/classes/*.html" | grep -c '\.html' || true) | |
| echo "Paginas HTML dentro del APK: $COUNT" | |
| if [ "$COUNT" -ne 195 ]; then | |
| echo "ERROR: el APK no contiene las 195 paginas de clases" | |
| exit 1 | |
| fi | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: AI-Evolution-Program-android-debug | |
| path: apps/android/android/app/build/outputs/apk/debug/app-debug.apk | |
| if-no-files-found: error |