xref: /expo/.github/workflows/client-ios.yml (revision 033ea1fc)
1name: iOS Client
2
3on:
4  workflow_dispatch:
5    inputs:
6      releaseSimulator:
7        description: 'type "release-simulator" to confirm upload'
8        required: false
9  schedule:
10    - cron: '20 5 * * 1,3,5' # 5:20 AM UTC time on every Monday, Wednesday and Friday
11  pull_request:
12    paths:
13      - .github/workflows/client-ios.yml
14      - ios/**
15      - tools/src/dynamic-macros/**
16      - tools/src/commands/IosGenerateDynamicMacros.ts
17      - tools/src/client-build/**
18      - tools/src/commands/ClientBuild.ts
19      - secrets/**
20      - fastlane/**
21      - Gemfile.lock
22      - yarn.lock
23  push:
24    branches: [main, sdk-*]
25    paths:
26      - .github/workflows/client-ios.yml
27      - ios/**
28      - tools/src/dynamic-macros/**
29      - tools/src/commands/IosGenerateDynamicMacros.ts
30      - tools/src/client-build/**
31      - tools/src/commands/ClientBuild.ts
32      - secrets/**
33      - fastlane/**
34      - Gemfile.lock
35      - yarn.lock
36
37concurrency:
38  group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
39  cancel-in-progress: true
40
41jobs:
42  build:
43    runs-on: macos-13
44    steps:
45      - name: �� Checkout
46        uses: actions/checkout@v3
47        with:
48          submodules: true
49      - name: �� Switch to Xcode 14.3
50        run: sudo xcode-select --switch /Applications/Xcode_14.3.app
51      - name: �� Decrypt secrets if possible
52        uses: ./.github/actions/expo-git-decrypt
53        with:
54          key: ${{ secrets.GIT_CRYPT_KEY_BASE64 }}
55      - name: ➕ Add `bin` to GITHUB_PATH
56        run: echo "$(pwd)/bin" >> $GITHUB_PATH
57      - name: �� Setup Ruby and install gems
58        uses: ruby/setup-ruby@v1
59        with:
60          bundler-cache: true
61          ruby-version: 3.2.2
62      - name: ♻️ Restore caches
63        uses: ./.github/actions/expo-caches
64        id: expo-caches
65        with:
66          yarn-workspace: 'true'
67          yarn-tools: 'true'
68          ios-pods: 'true'
69      - name: �� Yarn install
70        if: steps.expo-caches.outputs.yarn-workspace-hit != 'true'
71        run: yarn install --frozen-lockfile
72      - name: �� Generating dynamic macros
73        run: expotools ios-generate-dynamic-macros
74      - name: �� Install CocoaPods in `ios`
75        if: steps.expo-caches.outputs.ios-pods-hit != 'true'
76        run: pod install
77        working-directory: ios
78      - name: �� Check which flavor to build
79        id: flavor
80        uses: dorny/paths-filter@v2
81        with:
82          # this action fails when base is not set on schedule event
83          base: ${{ github.ref }}
84          filters: |
85            versioned:
86              - ios/versioned-react-native/**
87              - ios/Exponent/Versioned/**
88      - name: �� Build Expo Go for simulator
89        run: |
90          [[ "$IS_VERSIONED_FLAVOR" == "true" ]] && FLAVOR="versioned" || FLAVOR="unversioned"
91          echo "Building with $FLAVOR flavor"
92          expotools client-build --platform ios --flavor $FLAVOR
93        timeout-minutes: 120
94        env:
95          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
96          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
97          AWS_DEFAULT_REGION: 'us-east-1'
98          IS_VERSIONED_FLAVOR: ${{ github.event_name == 'schedule' || steps.flavor.outputs.versioned == 'true' }}
99      - name: �� Save test results
100        if: always()
101        uses: actions/upload-artifact@v3
102        with:
103          name: fastlane-logs
104          path: ~/Library/Logs/fastlane
105      - name: �� Release the simulator build
106        run: expotools client-build --platform ios --release # should only upload already-built app
107        if: ${{ github.event.inputs.releaseSimulator == 'release-simulator' }}
108        env:
109          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
110          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
111          AWS_DEFAULT_REGION: 'us-east-1'
112          EXPO_VERSIONS_SECRET: ${{ secrets.EXPO_VERSIONS_SECRET }}
113      - name: �� Notify on Slack
114        uses: 8398a7/action-slack@v3
115        if: failure() && (github.event.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/heads/sdk-'))
116        env:
117          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
118          SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_ios }}
119        with:
120          channel: '#expo-ios'
121          status: ${{ job.status }}
122          fields: job,message,ref,eventName,author,took
123          author_name: Expo Go (iOS)
124