Skip to content

Android Client - EAS Build #59

Android Client - EAS Build

Android Client - EAS Build #59

name: Android Client - EAS Build
on:
workflow_dispatch: {}
pull_request:
paths:
- .github/workflows/client-android-eas.yml
- apps/eas-expo-go/**
- apps/expo-go/android/**
push:
branches: [main, sdk-*]
paths:
- .github/workflows/client-android-eas.yml
- apps/eas-expo-go/**
- apps/expo-go/android/**
schedule:
- cron: '20 5 * * *' # 5:20 AM UTC time every day
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-22.04
if: ${{ github.event_name != 'pull_request' || (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]') }}
steps:
- name: 👀 Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: 🔓 Decrypt secrets if possible
uses: ./.github/actions/expo-git-decrypt
with:
key: ${{ secrets.GIT_CRYPT_KEY_BASE64 }}
- name: ➕ Add `bin` to GITHUB_PATH
run: echo "$(pwd)/bin" >> $GITHUB_PATH
- name: ♻️ Restore caches
uses: ./.github/actions/expo-caches
id: expo-caches
with:
yarn-workspace: 'true'
yarn-tools: 'true'
- name: 🧶 Yarn install
if: steps.expo-caches.outputs.yarn-workspace-hit != 'true'
run: yarn install --frozen-lockfile
- name: Install eas-cli
run: npm install -g eas-cli
- name: Generate local credentials.json
working-directory: ./apps/eas-expo-go
run: |
cat >credentials.json <<EOL
{
"android": {
"keystore": {
"keystorePath": "release.keystore",
"keystorePassword": "$ANDROID_KEYSTORE_PASSWORD",
"keyAlias": "ExponentKey",
"keyPassword": "$ANDROID_KEY_PASSWORD"
}
}
}
EOL
echo $ANDROID_KEYSTORE_B64 | base64 -d > release.keystore
env:
ANDROID_KEYSTORE_B64: ${{ secrets.ANDROID_KEYSTORE_B64 }}
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
- name: Build
uses: ./.github/actions/eas-build
id: build
with:
platform: 'android'
profile: 'unversioned-client'
projectRoot: './apps/eas-expo-go'
expoToken: ${{ secrets.EAS_BUILD_BOT_TOKEN }}
message: ${{ github.event.pull_request.title }}
- name: On workflow canceled
if: ${{ cancelled() && steps.build.outputs.build_id }}
run: eas build:cancel ${{ steps.build.outputs.build_id }}
working-directory: ./apps/eas-expo-go
env:
EXPO_TOKEN: ${{ secrets.EAS_BUILD_BOT_TOKEN }}
EAS_BUILD_PROFILE: 'unversioned-client'
- name: 🔔 Notify on Slack
uses: 8398a7/action-slack@v3
if: failure() && (github.event_name == 'schedule' || github.event.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/heads/sdk-'))
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_android }}
with:
channel: '#expo-android'
status: ${{ job.status }}
fields: job,message,ref,eventName,author,took
author_name: Expo Go (Android)