From c1e7a9c166138b7305456f484f35cce3bdca6761 Mon Sep 17 00:00:00 2001 From: isra el Date: Sat, 5 Apr 2025 14:32:40 +0300 Subject: [PATCH 1/2] infra: build android debug artifacts on push --- .github/workflows/build-and-test.yaml | 49 +++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index 8f4eb91f..db23e045 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -5,6 +5,7 @@ on: paths: - 'api/**' - 'web/**' + - 'android/**' - '.github/workflows/build-and-test.yaml' workflow_dispatch: @@ -16,8 +17,8 @@ on: type: string jobs: - build-and-test: - name: Build and Test + build-and-test-web-and-api: + name: Build and Test web and api runs-on: ubuntu-latest steps: @@ -62,4 +63,46 @@ jobs: cd web pnpm install pnpm run prisma:generate - pnpm run build \ No newline at end of file + pnpm run build + + build-and-test-android: + name: Build and Test Android + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ github.event_name == 'workflow_dispatch' && inputs.branch || github.ref }} + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: gradle + + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + with: + gradle-version: '7.2' + + - name: Grant execute permission for gradlew + run: chmod +x android/gradlew + + - name: Build Android app + run: | + cd android + ./gradlew assembleDebug + + # - name: Run Android tests + # run: | + # cd android + # ./gradlew testDebugUnitTest + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: android-apk + path: android/app/build/outputs/apk/debug/app-debug.apk + retention-days: 7 \ No newline at end of file From 80354f7d3f7d0f20a654bb4348c55215e1361c22 Mon Sep 17 00:00:00 2001 From: isra el Date: Sat, 5 Apr 2025 14:54:44 +0300 Subject: [PATCH 2/2] infra: update android apk artifact naming --- .github/workflows/build-and-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index db23e045..5ab7ea83 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -103,6 +103,6 @@ jobs: - name: Upload build artifacts uses: actions/upload-artifact@v4 with: - name: android-apk + name: textbee.dev-build-${{ github.ref_name }}-${{ github.sha }}.apk path: android/app/build/outputs/apk/debug/app-debug.apk retention-days: 7 \ No newline at end of file