1name: Android Client - EAS Build 2 3on: 4 workflow_dispatch: 5 inputs: 6 buildType: 7 required: true 8 type: 'choice' 9 description: 'buildType' 10 options: 11 - versioned-client 12 - unversioned-client 13 - versioned-client-signed 14 - versioned-client-signed-apk 15 - versioned-client-add-sdk 16 schedule: 17 # 5:20 AM UTC time on every Monday, Wednesday and Friday 18 # Build a versioned client 19 - cron: '20 5 * * 1,3,5' 20 # 5:20 AM UTC time on every Monday 21 # Run versioning process for the next sdk and build a versioned client 22 - cron: '20 5 * * 1' 23 pull_request: 24 paths: 25 - .github/workflows/client-android-eas.yml 26 - apps/eas-expo-go/** 27 28 29concurrency: 30 group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} 31 cancel-in-progress: true 32 33jobs: 34 build: 35 runs-on: ubuntu-20.04 36 steps: 37 - name: Checkout 38 uses: actions/checkout@v3 39 with: 40 submodules: true 41 - name: Decrypt secrets if possible 42 uses: ./.github/actions/expo-git-decrypt 43 with: 44 key: ${{ secrets.GIT_CRYPT_KEY_BASE64 }} 45 - name: ➕ Add `bin` to GITHUB_PATH 46 run: echo "$(pwd)/bin" >> $GITHUB_PATH 47 - name: ♻️ Restore caches 48 uses: ./.github/actions/expo-caches 49 id: expo-caches 50 with: 51 yarn-workspace: 'true' 52 yarn-tools: 'true' 53 - name: Yarn install 54 if: steps.expo-caches.outputs.yarn-workspace-hit != 'true' 55 run: yarn install --frozen-lockfile 56 - name: Install eas-cli 57 run: npm install -g eas-cli 58 - name: Check which flavor to build 59 id: flavor 60 uses: dorny/paths-filter@v2 61 with: 62 # this action fails when base is not set on schedule event 63 base: ${{ github.ref }} 64 filters: | 65 versioned: 66 - android/versioned-abis/** 67 - android/versioned-react-native/** 68 - android/expoview/src/versioned/** 69 - android/expoview/src/main/java/versioned/** 70 - android/**/*.gradle 71 - name: Resolve profile 72 id: profile 73 run: | 74 DISPATCH_PROFILE="${{ github.event.inputs.buildType }}" 75 IS_VERSIONED="${{ steps.flavor.outputs.versioned }}" 76 if [[ ! -z "$DISPATCH_PROFILE" ]]; then 77 echo ::set-output name=profile::"$DISPATCH_PROFILE" 78 elif [[ "${{ github.event.schedule }}" == "20 5 * * 1,3,5" ]]; then 79 echo ::set-output name=profile::"versioned-client" 80 elif [[ "${{ github.event.schedule }}" == "20 5 * * 1" ]]; then 81 echo ::set-output name=profile::"versioned-client-add-sdk" 82 elif [[ "$IS_VERSIONED" == "true" ]]; then 83 echo ::set-output name=profile::"versioned-client" 84 else 85 echo ::set-output name=profile::"unversioned-client" 86 fi 87 - name: Build 88 uses: ./.github/actions/eas-build 89 id: build 90 with: 91 platform: 'android' 92 profile: ${{ steps.profile.outputs.profile }} 93 projectRoot: './apps/eas-expo-go' 94 expoToken: ${{ secrets.EAS_BUILD_BOT_TOKEN }} 95 resourceClass: large 96 noWait: ${{ github.event.schedule }} 97 - name: On workflow canceled 98 if: ${{ cancelled() && steps.build.outputs.build_id }} 99 run: eas build:cancel ${{ steps.build.outputs.build_id }} 100 working-directory: ./apps/eas-expo-go 101 env: 102 EXPO_TOKEN: ${{ secrets.EAS_BUILD_BOT_TOKEN }} 103 EAS_BUILD_PROFILE: ${{ steps.profile.outputs.profile }} 104