Build Android Code Studio #58
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 Code Studio | |
| on: | |
| push: | |
| branches: | |
| - "dev" | |
| - "main" | |
| - "indexing" | |
| - "release/**" | |
| 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: | |
| inputs: | |
| build_type: | |
| description: 'Select Build Type' | |
| required: true | |
| default: 'Debug' | |
| type: choice | |
| options: | |
| - Debug | |
| - Release | |
| jobs: | |
| build_release_apk: | |
| name: Build APK | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Cancel previous runs | |
| uses: styfle/cancel-workflow-action@0.12.1 | |
| with: | |
| access_token: ${{ github.token }} | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| fetch-depth: 0 | |
| - name: Determine Build Type Configuration | |
| run: | | |
| SELECTED_TYPE="${{ github.event.inputs.build_type }}" | |
| BUILD_TYPE="${SELECTED_TYPE:-Debug}" | |
| echo "BUILD_TYPE=$BUILD_TYPE" >> $GITHUB_ENV | |
| echo "BUILD_TYPE_LOWER=$(echo "$BUILD_TYPE" | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
| - 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 | |
| run: | | |
| 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 APK | |
| run: ./gradlew assemble${{ env.BUILD_TYPE }} | |
| - name: List APK files | |
| run: ls -la core/app/build/outputs/apk/${{ env.BUILD_TYPE_LOWER }}/ || echo "Directory not found" | |
| - name: Upload arm64-v8a APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: apk-arm64-v8a-${{ env.BUILD_TYPE_LOWER }} | |
| path: core/app/build/outputs/apk/${{ env.BUILD_TYPE_LOWER }}/*arm64-v8a*.apk | |
| if: always() | |
| - name: Upload armeabi-v7a APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: apk-armeabi-v7a-${{ env.BUILD_TYPE_LOWER }} | |
| path: core/app/build/outputs/apk/${{ env.BUILD_TYPE_LOWER }}/*armeabi-v7a*.apk | |
| if: always() | |
| - name: Upload x86_64 APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: apk-x86_64-${{ env.BUILD_TYPE_LOWER }} | |
| path: core/app/build/outputs/apk/${{ env.BUILD_TYPE_LOWER }}/*x86_64*.apk | |
| if: always() | |
| - name: Upload universal APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: apk-universal-${{ env.BUILD_TYPE_LOWER }} | |
| path: core/app/build/outputs/apk/${{ env.BUILD_TYPE_LOWER }}/*universal*.apk | |
| if: always() |