|
1 | | -name: Android CI Build |
| 1 | +name: Build Android Code Studio |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | | - branches: [ main ] |
| 5 | + branches: |
| 6 | + - "dev" |
| 7 | + - "main" |
| 8 | + - "indexing" |
| 9 | + - "release/**" |
| 10 | + paths-ignore: |
| 11 | + - '**.md' |
| 12 | + - '**.json' |
| 13 | + - 'fastlane/**' |
| 14 | + - '.github/workflows/crowdin_contributors.yml' |
6 | 15 | pull_request: |
7 | | - branches: [ main ] |
| 16 | + branches: [ "dev" ] |
| 17 | + paths-ignore: |
| 18 | + - '**.md' |
| 19 | + - '**.json' |
| 20 | + - 'fastlane/**' |
| 21 | + - '.github/workflows/crowdin_contributors.yml' |
| 22 | + workflow_dispatch: { } |
8 | 23 |
|
9 | 24 | jobs: |
10 | | - build: |
| 25 | + build_release_apk: |
| 26 | + name: Build Debug APK |
11 | 27 | runs-on: ubuntu-latest |
12 | | - |
13 | 28 | steps: |
14 | | - - name: Checkout code |
| 29 | + - name: Cancel previous runs |
| 30 | + uses: styfle/cancel-workflow-action@0.12.1 |
| 31 | + with: |
| 32 | + access_token: ${{ github.token }} |
| 33 | + - name: Checkout |
15 | 34 | uses: actions/checkout@v4 |
16 | | - |
| 35 | + with: |
| 36 | + submodules: 'recursive' |
| 37 | + fetch-depth: 0 |
17 | 38 | - name: Set up JDK 17 |
18 | | - uses: actions/setup-java@v3 |
| 39 | + uses: actions/setup-java@v4 |
19 | 40 | with: |
20 | 41 | java-version: '17' |
21 | | - distribution: 'temurin' |
22 | | - cache: gradle |
23 | | - |
24 | | - - name: Grant execute permission for gradlew |
25 | | - run: chmod +x gradlew |
26 | | - |
27 | | - - name: Build Android Code Studio |
| 42 | + distribution: 'adopt' |
| 43 | + - name: Change Gradle wrapper permissions |
| 44 | + run: chmod +x ./gradlew |
| 45 | + - name: Restore cache |
| 46 | + uses: actions/cache@v4 |
| 47 | + with: |
| 48 | + path: | |
| 49 | + ~/.gradle/caches |
| 50 | + ~/.gradle/wrapper |
| 51 | + key: ${{ runner.os }}-gradle-v2-${{ hashFiles('**/*.gradle*') }} |
| 52 | + restore-keys: | |
| 53 | + ${{ runner.os }}-gradle- |
| 54 | + - name: Create local.properties |
28 | 55 | run: | |
29 | | - # 1. Server Memory saaf karne ke liye Deep Clean |
30 | | - ./gradlew clean |
31 | | - |
32 | | - # 2. Resource Conflict aur IllegalStateException se bachne ke liye sequential build |
33 | | - # --parallel=false: Tasks ek-ek karke chalenge |
34 | | - # --max-workers=1: Server load manage karne ke liye |
35 | | - # --no-daemon: Server memory leak se bachne ke liye |
36 | | - |
37 | | - ./gradlew :core:app:assembleDebug \ |
38 | | - --no-daemon \ |
39 | | - --parallel=false \ |
40 | | - --max-workers=1 \ |
41 | | - --stacktrace |
42 | | -
|
43 | | - - name: Upload APK Artifact |
| 56 | + echo "signing.storeFile=signing/signing-key.jks" >> local.properties |
| 57 | + echo "signing.storePassword=123456" >> local.properties |
| 58 | + echo "signing.keyAlias=android-ide" >> local.properties |
| 59 | + echo "signing.keyPassword=123456" >> local.properties |
| 60 | + - name: Debug signing setup |
| 61 | + run: | |
| 62 | + echo "=== Repository structure ===" |
| 63 | + find . -name "*.jks" -o -name "local.properties" | head -10 |
| 64 | + echo "" |
| 65 | + echo "=== local.properties content ===" |
| 66 | + cat local.properties || echo "local.properties not found" |
| 67 | + echo "" |
| 68 | + echo "=== SigningDirectory ===" |
| 69 | + ls -la core/app/signing/ || echo "core/app/signing directory not found" |
| 70 | + - name: Assemble Debug APK |
| 71 | + run: ./gradlew :core:app:assembleDebug |
| 72 | + # run: ./gradlew :core:app:assembleRelease |
| 73 | + - name: List APK files (debug) |
| 74 | + run: ls -la core/app/build/outputs/apk/debug/ |
| 75 | + - name: Upload arm64-v8a Release APK |
| 76 | + uses: actions/upload-artifact@v4 |
| 77 | + with: |
| 78 | + name: apk-arm64-v8a-debug |
| 79 | + path: core/app/build/outputs/apk/debug/*arm64-v8a*.apk |
| 80 | + if: always() |
| 81 | + - name: Upload armeabi-v7a Release APK |
| 82 | + uses: actions/upload-artifact@v4 |
| 83 | + with: |
| 84 | + name: apk-armeabi-v7a-release |
| 85 | + path: core/app/build/outputs/apk/release/*armeabi-v7a*.apk |
| 86 | + if: always() |
| 87 | + - name: Upload x86_64 Release APK |
| 88 | + uses: actions/upload-artifact@v4 |
| 89 | + with: |
| 90 | + name: apk-x86_64-release |
| 91 | + path: core/app/build/outputs/apk/release/*x86_64*.apk |
| 92 | + if: always() |
| 93 | + - name: Upload universal Release APK |
44 | 94 | uses: actions/upload-artifact@v4 |
45 | 95 | with: |
46 | | - name: android-code-studio-debug |
47 | | - # Path ensure karta hai ki sahi APK mil jaye |
48 | | - path: core/app/build/outputs/apk/debug/*.apk |
49 | | - if-no-files-found: error |
| 96 | + name: apk-universal-release |
| 97 | + path: core/app/build/outputs/apk/release/*universal*.apk |
| 98 | + if: always() |
0 commit comments