xref: /expo/.github/workflows/client-ios.yml (revision bb8f4f99)
1name: iOS Client
2
3on:
4  workflow_dispatch:
5    inputs:
6      releaseSimulator:
7        description: 'type "release-simulator" to confirm upload'
8        required: false
9  pull_request:
10    branches: [master]
11    paths:
12      - .github/workflows/client-ios.yml
13      - ios/**
14      - tools/**
15      - secrets/**
16      - fastlane/**
17      - Gemfile.lock
18      - .ruby-version
19  push:
20    branches: [master, sdk-*]
21    paths:
22      - .github/workflows/client-ios.yml
23      - ios/**
24      - tools/**
25      - secrets/**
26      - fastlane/**
27      - Gemfile.lock
28      - .ruby-version
29
30jobs:
31  build:
32    runs-on: macos-10.15
33    steps:
34      - uses: actions/checkout@v2
35        with:
36          submodules: true
37      - run: brew install git-crypt
38      - name: decrypt secrets if possible
39        env:
40          GIT_CRYPT_KEY_BASE64: ${{ secrets.GIT_CRYPT_KEY_BASE64 }}
41        run: |
42          if [[ ${GIT_CRYPT_KEY_BASE64:-unset} = unset ]]; then
43            echo 'git-crypt key not present in environment'
44          else
45            git crypt unlock <(echo $GIT_CRYPT_KEY_BASE64 | base64 --decode)
46          fi
47      - run: echo "$(pwd)/bin" >> $GITHUB_PATH
48      - name: Get yarn cache directory path
49        id: yarn-cache-dir-path
50        run: echo "::set-output name=dir::$(yarn cache dir)"
51      - name: ♻️ Restore yarn cache
52        uses: actions/cache@v2
53        with:
54          path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
55          key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
56          restore-keys: |
57            ${{ runner.os }}-yarn-
58      - name: �� Yarn install
59        run: yarn install --frozen-lockfile
60      - name: ♻️ Restore tools/node_modules from cache
61        uses: actions/cache@v2
62        with:
63          path: 'tools/node_modules'
64          key: ${{ runner.os }}-modules-${{ hashFiles('tools/yarn.lock') }}
65      - run: expotools ios-generate-dynamic-macros
66      - uses: ruby/setup-ruby@v1
67        with:
68          bundler-cache: true
69      - name: Restore ios/Pods from cache
70        uses: actions/cache@v2
71        with:
72          path: 'ios/Pods'
73          key: ${{ runner.os }}-pods-${{ hashFiles('ios/Podfile.lock') }}
74          restore-keys: |
75            ${{ runner.os }}-pods-
76      - run: expotools client-build --platform ios
77        timeout-minutes: 120
78        env:
79          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
80          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
81      - name: Save test results
82        if: always()
83        uses: actions/upload-artifact@v2
84        with:
85          name: fastlane-logs
86          path: ~/Library/Logs/fastlane
87      - run: expotools client-build --platform ios --release # should only upload already-built app
88        if: ${{ github.event.inputs.releaseSimulator == 'release-simulator' }}
89        env:
90          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
91          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
92          EXPO_VERSIONS_SECRET: ${{ secrets.EXPO_VERSIONS_SECRET }}
93      - name: �� Notify on Slack
94        uses: 8398a7/action-slack@v3
95        if: failure() && (github.event.ref == 'refs/heads/master' || startsWith(github.event.ref, 'refs/heads/sdk-'))
96        env:
97          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98          SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_ios }}
99        with:
100          channel: '#platform-ios'
101          status: ${{ job.status }}
102          fields: job,commit,ref,eventName,author,took
103          author_name: Expo Go (iOS)
104