From 7549338567953731cf3b621c85127bc38d737e76 Mon Sep 17 00:00:00 2001 From: Mostafa Mohamed <41519636+MostafaMohamed2002@users.noreply.github.com> Date: Thu, 2 May 2024 07:32:09 +0300 Subject: [PATCH] Update android_ci.yml --- .github/workflows/android_ci.yml | 38 ++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/.github/workflows/android_ci.yml b/.github/workflows/android_ci.yml index 41dda07..e98bc88 100644 --- a/.github/workflows/android_ci.yml +++ b/.github/workflows/android_ci.yml @@ -1,13 +1,12 @@ -name: Android CI/CD +name: Android Debug Release on: push: - branches: [ master ] - pull_request: - branches: [ master ] + branches: + - master # Adjust this if you want to build on a different branch jobs: - build: + build_and_release: runs-on: ubuntu-latest steps: @@ -17,15 +16,36 @@ jobs: with: java-version: '11' distribution: 'adopt' - + - name: Grant execute permission for gradlew run: chmod +x ./gradlew - name: Build Debug APK run: ./gradlew assembleDebug - - name: Upload APK to GitHub Packages + - name: Upload Debug APK uses: actions/upload-artifact@v3 with: - name: app-release - path: app/build/outputs/apk/release/*.apk + name: app-debug + path: app/build/outputs/apk/debug/*.apk + + - name: Create Release + id: create_release + uses: actions/create-release@v3 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: debug-${{ github.run_number }} + release_name: Debug Release ${{ github.run_number }} + draft: false + prerelease: true + + - name: Upload APK to Release + uses: actions/upload-release-asset@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./app/build/outputs/apk/debug/*.apk + asset_name: app-debug.apk + asset_content_type: application/vnd.android.package-archive