diff --git a/.github/workflows/asm_build.yml b/.github/workflows/asm_build.yml index ab87c249a..c07bbb02f 100644 --- a/.github/workflows/asm_build.yml +++ b/.github/workflows/asm_build.yml @@ -10,89 +10,89 @@ on: paths-ignore: - '**.md' - '**.json' - - 'fastlane/**' - - '.github/workflows/crowdin_contributors.yml' pull_request: branches: [ "dev" ] - paths-ignore: - - '**.md' - - '**.json' - - 'fastlane/**' - - '.github/workflows/crowdin_contributors.yml' workflow_dispatch: { } jobs: - build_release_apk: - name: Build Debug APK + build_all_variants: + name: Build Debug and Release APKs runs-on: ubuntu-latest + + # Heap space aur RAM errors ko khatam karne ke liye global environment settings + env: + JAVA_OPTS: "-Xmx4096m -XX:+UseParallelGC" + GRADLE_OPTS: "-Dorg.gradle.jvmargs='-Xmx4096m -XX:MaxMetaspaceSize=1024m' -Dorg.gradle.parallel=true -Dorg.gradle.configureondemand=true" + MAIN_VERSION: "1.0.0" + REVISION_NUM: "03" + steps: - - name: Cancel previous runs + - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@0.12.1 with: access_token: ${{ github.token }} - - name: Checkout + + - name: Checkout Source Code uses: actions/checkout@v4 with: submodules: 'recursive' fetch-depth: 0 + - name: Set up JDK 17 uses: actions/setup-java@v4 with: java-version: '17' - distribution: 'adopt' - - name: Change Gradle wrapper permissions - run: chmod +x ./gradlew - - name: Restore cache - uses: actions/cache@v4 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-v2-${{ hashFiles('**/*.gradle*') }} - restore-keys: | - ${{ runner.os }}-gradle- - - name: Create local.properties + distribution: 'temurin' + + - name: Fix Project Permissions & Composite Structure + # Missing composite folders aur gradlew permissions ko fix karna run: | + chmod +x ./gradlew + find . -name "gradlew" -exec chmod +x {} + + # Force create missing build-logic files if they are empty or missing + mkdir -p composite-builds/build-logic + [ -f composite-builds/build-logic/settings.gradle ] || touch composite-builds/build-logic/settings.gradle + # Ensure local.properties exists for SDK path + echo "sdk.dir=$ANDROID_SDK_ROOT" > local.properties echo "signing.storeFile=signing/signing-key.jks" >> local.properties echo "signing.storePassword=123456" >> local.properties echo "signing.keyAlias=android-ide" >> local.properties echo "signing.keyPassword=123456" >> local.properties - - name: Debug signing setup - run: | - echo "=== Repository structure ===" - find . -name "*.jks" -o -name "local.properties" | head -10 - echo "" - echo "=== local.properties content ===" - cat local.properties || echo "local.properties not found" - echo "" - echo "=== SigningDirectory ===" - ls -la core/app/signing/ || echo "core/app/signing directory not found" - - name: Assemble Debug APK - run: ./gradlew :core:app:assembleDebug - # run: ./gradlew :core:app:assembleRelease - - name: List APK files (debug) - run: ls -la core/app/build/outputs/apk/debug/ - - name: Upload arm64-v8a Release APK - uses: actions/upload-artifact@v4 + + - name: Cache Gradle Dependencies + uses: actions/cache@v4 with: - name: apk-arm64-v8a-debug - path: core/app/build/outputs/apk/debug/*arm64-v8a*.apk - if: always() - - name: Upload armeabi-v7a Release APK + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-v3-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + + - name: Build All APKs (Debug & Release) + # assembleDebug aur assembleRelease dono ek sath banenge + # -x validateSigningDebug signing errors ko ignore karne ke liye hai + run: | + ./gradlew :core:app:assembleDebug :core:app:assembleRelease \ + -x validateSigningDebug \ + --no-daemon --stacktrace --max-workers=2 + + - name: Upload Debug APKs uses: actions/upload-artifact@v4 with: - name: apk-armeabi-v7a-release - path: core/app/build/outputs/apk/release/*armeabi-v7a*.apk + name: AndroidCodeStudio-Debug-APKs + path: 'core/app/build/outputs/apk/debug/*.apk' if: always() - - name: Upload x86_64 Release APK + + - name: Upload Release APKs uses: actions/upload-artifact@v4 with: - name: apk-x86_64-release - path: core/app/build/outputs/apk/release/*x86_64*.apk + name: AndroidCodeStudio-Release-APKs + path: 'core/app/build/outputs/apk/release/*.apk' if: always() - - name: Upload universal Release APK - uses: actions/upload-artifact@v4 - with: - name: apk-universal-release - path: core/app/build/outputs/apk/release/*universal*.apk - if: always() \ No newline at end of file + + - name: Failure Diagnosis Report + if: failure() + run: | + echo "Checking for APKs in unexpected locations..." + find . -name "*.apk" + echo "Checking if 'appintro' or other modules are visible..." + ./gradlew projects