Update App.tsx #14
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: Build Android APK | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| build-android: | |
| name: Build APK | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Source | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Setup Java JDK | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '17' | |
| - name: Install Dependencies | |
| run: | | |
| npm install | |
| # Install Capacitor dependencies explicitly to ensure availability | |
| npm install @capacitor/core @capacitor/cli @capacitor/android @capacitor/assets @capacitor/filesystem @capacitor/share --save | |
| - name: Build Web App | |
| run: npm run build | |
| - name: Initialize Capacitor & Android | |
| run: | | |
| npx cap add android | |
| # --- ROBUST ICON CREATION --- | |
| - name: Create Custom Icon Asset | |
| run: | | |
| mkdir -p assets | |
| # Create the SVG file. | |
| # We use a simple SVG that represents the Cipher Academy brand (Circuit Key). | |
| cat <<EOF > assets/logo.svg | |
| <svg viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"> | |
| <rect width="100" height="100" fill="#050505"/> | |
| <path d="M 75 25 L 35 25 L 15 50 L 35 75 L 75 75" stroke="#C5A059" stroke-width="6" stroke-linecap="round" stroke-linejoin="round"/> | |
| <circle cx="40" cy="50" r="10" stroke="#C5A059" stroke-width="6"/> | |
| <path d="M 50 50 L 85 50" stroke="#C5A059" stroke-width="6" stroke-linecap="round"/> | |
| <path d="M 68 50 L 68 62" stroke="#C5A059" stroke-width="6" stroke-linecap="round"/> | |
| <path d="M 78 50 L 78 58" stroke="#C5A059" stroke-width="6" stroke-linecap="round"/> | |
| </svg> | |
| EOF | |
| # Verify file creation | |
| echo "Listing assets directory to confirm creation:" | |
| ls -la assets/ | |
| - name: Generate Android Icons | |
| # FIX: --assetPath must point to the DIRECTORY ('assets'), not the file. | |
| # The tool automatically looks for 'logo.svg' inside 'assets'. | |
| run: | | |
| npx @capacitor/assets generate --iconBackgroundColor '#050505' --splashBackgroundColor '#050505' --assetPath assets --android | |
| - name: Sync Capacitor | |
| run: npx cap sync android | |
| - name: Build APK with Gradle | |
| run: | | |
| cd android | |
| chmod +x gradlew | |
| ./gradlew assembleDebug | |
| - name: Upload APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cipher-academy-apk | |
| path: android/app/build/outputs/apk/debug/app-debug.apk |