Fix build after AGP 9.1.1 and Gradle 9.4.1 #23
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: | |
| releasetag: | |
| description: Enter the tag name | |
| type: string | |
| buildType: | |
| description: "debug or release" | |
| required: true | |
| type: choice | |
| options: | |
| - debug | |
| - release | |
| default: debug | |
| permissions: | |
| contents: write | |
| jobs: | |
| build_release_apk: | |
| name: Build Debug 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: 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: Build APK | |
| run: | | |
| if [ "${{ github.event.inputs.buildType }}" = "release" ]; then | |
| ./gradlew assembleRelease \ | |
| -PKEYSTORE_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }} \ | |
| -PKEY_PASSWORD=${{ secrets.KEY_PASSWORD }} | |
| else | |
| ./gradlew assembleDebug | |
| fi | |
| env: | |
| KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | |
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| - name: Create GitHub Release | |
| if: github.event_name == 'workflow_dispatch' && github.event.inputs.buildType == 'release' | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| tag_name: ${{ inputs.releasetag }} | |
| files: core/app/build/outputs/apk/release/*.apk | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
| - name: Upload APK | |
| if: github.event_name == 'workflow_dispatch' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ github.event.inputs.buildType }}-apk | |
| path: core/app/build/outputs/apk/${{ github.event.inputs.buildType }}/*.apk | |
| retention-days: 7 |