From 9cca8ebc3547336e396635db815ad147376302b7 Mon Sep 17 00:00:00 2001 From: arafat-alim Date: Wed, 30 Oct 2024 14:17:03 +0530 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20GH=20Action:=20Updated=20t?= =?UTF-8?q?he=20script=20for=20handling=20failure=20cases.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gh-actions-expo-build-staging.yml | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/workflows/gh-actions-expo-build-staging.yml b/.github/workflows/gh-actions-expo-build-staging.yml index d3c8ea0..3b9f1d2 100644 --- a/.github/workflows/gh-actions-expo-build-staging.yml +++ b/.github/workflows/gh-actions-expo-build-staging.yml @@ -4,42 +4,55 @@ on: push: branches: - staging + jobs: build: runs-on: ubuntu-latest steps: - - name: Setup repo + # Step 1: Check out the repository code + - name: Checkout repository uses: actions/checkout@v4 - - name: Setup node + # Step 2: Set up Node.js environment with caching for faster installs + - name: Setup Node.js uses: actions/setup-node@v3 with: node-version: 20.x cache: "npm" + # Step 3: Set up JDK 17 for Android build compatibility - name: Set up JDK 17 uses: actions/setup-java@v3 with: java-version: "17" distribution: "temurin" + # Step 4: Install the Android SDK - name: Setup Android SDK uses: android-actions/setup-android@v3 - - name: Setup Expo + # Step 5: Install Expo CLI and EAS CLI, passing Expo token for authentication + - name: Install Expo CLI and EAS CLI uses: expo/expo-github-action@v8 with: - expo-version: latest - eas-version: latest - token: ${{ secrets.EXPO_TOKEN }} + expo-version: "6.3.2" # Specify Expo CLI version for stability + eas-version: "3.7.2" # Specify EAS CLI version for stability + token: ${{ secrets.EXPO_TOKEN }} # Use Expo token for authentication + # Step 6: Install project dependencies with Yarn - name: Install dependencies run: yarn install --frozen-lockfile + # Step 7: Build the Android APK using EAS - name: Build Android app - run: eas build --platform android --profile preview --local --output ${{ github.workspace }}/app-release.apk + run: | + eas build --platform android --profile preview --local --output ${{ github.workspace }}/app-release.apk + continue-on-error: false # Ensures the job fails on build error + + # Step 8: Upload the generated APK file as an artifact for download - name: Upload APK artifact - uses: actions/upload-artifact@v4 + if: success() # Run only if the build step succeeded + uses: actions/upload-artifact@v4 # Updated to v4 to avoid deprecation with: name: app-release path: ${{ github.workspace }}/app-release.apk