From fc45022f2b594f1382b6c23f022db0f7ad3ec8be Mon Sep 17 00:00:00 2001 From: Mohamed Ali Ebaid Date: Sun, 26 May 2024 14:54:43 +0300 Subject: [PATCH] Create android.yml --- .github/workflows/android.yml | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/android.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 0000000..4b22a99 --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,45 @@ +name: Android CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + cache: gradle + + - name: Check if Gradle Build Exists + run: | + if [ ! -f ./settings.gradle ] && [ ! -f ./settings.gradle.kts ]; then + echo "Gradle build files not found, initializing new Gradle project..." + gradle init --type basic + else + echo "Gradle build files found." + fi + + - name: Generate Gradle Wrapper if Missing + run: | + if [ ! -f ./gradlew ]; then + echo "Gradle wrapper not found, generating..." + gradle wrapper + else + echo "Gradle wrapper found." + fi + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build with Gradle + run: ./gradlew build