xref: /expo/.github/workflows/client-ios-eas.yml (revision 88331e54)
1name: iOS 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-add-sdk
15  schedule:
16    # 5:20 AM UTC time on every Monday, Wednesday and Friday
17    # Build a versioned client
18    - cron: '20 5 * * 1,3,5'
19    # 5:20 AM UTC time on every Monday
20    # Run versioning process for the next sdk and build a versioned client
21    - cron: '20 5 * * 1'
22  pull_request:
23    paths:
24      - .github/workflows/client-ios-eas.yml
25      - apps/eas-expo-go/**
26      - ios/**
27      - tools/src/dynamic-macros/**
28      - tools/src/commands/IosGenerateDynamicMacros.ts
29      - tools/src/client-build/**
30      - tools/src/commands/ClientBuild.ts
31      - secrets/**
32      - fastlane/**
33      - Gemfile.lock
34      - .ruby-version
35      - yarn.lock
36  push:
37    branches: [main, sdk-*]
38    paths:
39      - .github/workflows/client-ios-eas.yml
40      - apps/eas-expo-go/**
41      - ios/**
42      - tools/src/dynamic-macros/**
43      - tools/src/commands/IosGenerateDynamicMacros.ts
44      - tools/src/client-build/**
45      - tools/src/commands/ClientBuild.ts
46      - secrets/**
47      - fastlane/**
48      - Gemfile.lock
49      - .ruby-version
50      - yarn.lock
51
52concurrency:
53  group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
54  cancel-in-progress: true
55
56jobs:
57  build:
58    runs-on: ubuntu-20.04
59    steps:
60      - name: �� Checkout
61        uses: actions/checkout@v3
62        with:
63          submodules: true
64      - name: �� Decrypt secrets if possible
65        uses: ./.github/actions/expo-git-decrypt
66        with:
67          key: ${{ secrets.GIT_CRYPT_KEY_BASE64 }}
68      - name: ➕ Add `bin` to GITHUB_PATH
69        run: echo "$(pwd)/bin" >> $GITHUB_PATH
70      - name: ♻️ Restore caches
71        uses: ./.github/actions/expo-caches
72        id: expo-caches
73        with:
74          yarn-workspace: 'true'
75          yarn-tools: 'true'
76      - name: �� Yarn install
77        if: steps.expo-caches.outputs.yarn-workspace-hit != 'true'
78        run: yarn install --frozen-lockfile
79      - name: Install eas-cli
80        run: npm install -g eas-cli
81      - name: �� Check which flavor to build
82        id: flavor
83        uses: dorny/paths-filter@v2
84        with:
85          # this action fails when base is not set on schedule event
86          base: ${{ github.ref }}
87          filters: |
88            versioned:
89              - ios/versioned-react-native/**
90              - ios/Exponent/Versioned/**
91      - name: Resolve profile
92        id: profile
93        run: |
94          DISPATCH_PROFILE="${{ github.event.inputs.buildType }}"
95          IS_VERSIONED="${{ steps.flavor.outputs.versioned }}"
96          if [[ ! -z "$DISPATCH_PROFILE" ]]; then
97            echo ::set-output name=profile::"$DISPATCH_PROFILE"
98          elif [[ "${{ github.event.schedule }}" == "20 5 * * 1,3,5" ]]; then
99            echo ::set-output name=profile::"versioned-client"
100          elif [[ "${{ github.event.schedule }}" == "20 5 * * 1" ]]; then
101            echo ::set-output name=profile::"versioned-client-add-sdk"
102          elif [[ "$IS_VERSIONED" == "true" ]]; then
103            echo ::set-output name=profile::"versioned-client"
104          else
105            echo ::set-output name=profile::"unversioned-client"
106          fi
107      - name: Build
108        uses: ./.github/actions/eas-build
109        id: build
110        with:
111          platform: 'ios'
112          profile: ${{ steps.profile.outputs.profile  }}
113          projectRoot: './apps/eas-expo-go'
114          expoToken: ${{ secrets.EAS_BUILD_BOT_TOKEN }}
115          resourceClass: default
116          noWait: ${{ github.event.schedule }}
117          message: ${{ github.event.pull_request.title }}
118      - name: On workflow canceled
119        if: ${{ cancelled() && steps.build.outputs.build_id }}
120        run: eas build:cancel ${{ steps.build.outputs.build_id }}
121        working-directory: ./apps/eas-expo-go
122        env:
123          EXPO_TOKEN: ${{ secrets.EAS_BUILD_BOT_TOKEN }}
124          EAS_BUILD_PROFILE: ${{ steps.profile.outputs.profile  }}
125