⬆️ GH Action: EAS login issue, made neccessary changes. #4
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 App APK Build | |
on: | |
push: | |
branches: | |
- staging | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Check out the repository code | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# 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 | |
# Step 5: Install Expo CLI and EAS CLI | |
- name: Install Expo CLI and EAS CLI | |
run: npm install -g expo-cli eas-cli | |
# Step 6: Authenticate with EAS using the token | |
- name: Authenticate with EAS | |
env: | |
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }} | |
run: echo "$EXPO_TOKEN" | eas login --token - | |
# Step 7: Install project dependencies with Yarn | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
# Step 8: Build the Android APK using EAS | |
- name: Build Android app | |
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 9: Upload the generated APK file as an artifact for download | |
- name: Upload APK artifact | |
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 |