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