Update build.gradle #43
This file contains 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: Android CI | |
on: | |
push: | |
branches: [ "main" ] | |
paths-ignore: | |
- '**/*.md' | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Check out the repository | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
# Step 2: Set up JDK 17 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
# Step 3: Grant execute permission for gradlew | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
# Step 4: Clean the project | |
- name: Clean project | |
run: ./gradlew clean | |
# Step 5: Build with Gradle | |
- name: Build with Gradle | |
run: ./gradlew assembleRelease | |
# Step 6: Print mapping file if build fails | |
- name: Print mapping file | |
if: failure() | |
run: cat filetree/build/outputs/mapping/release/mapping.txt | |
- name: Print missing rules | |
if: failure() | |
run: cat filetree/build/outputs/mapping/release/missing_rules.txt | |
# Step 7: Archive the debug APK | |
- name: Archive debug APK | |
uses: actions/upload-artifact@v2 | |
with: | |
name: app-debug | |
path: app/build/outputs/apk/debug/app-debug.apk | |
# Step 8: Archive the release APK | |
- name: Archive release APK | |
uses: actions/upload-artifact@v2 | |
with: | |
name: app-release | |
path: app/build/outputs/apk/release/app-release.apk |