xref: /expo/.github/workflows/client-ios.yml (revision 98629a0c)
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/expotools/**
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/expotools/**
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          lfs: true
38      - run: brew install git-crypt
39      - name: decrypt secrets if possible
40        env:
41          GIT_CRYPT_KEY_BASE64: ${{ secrets.GIT_CRYPT_KEY_BASE64 }}
42        run: |
43          if [[ ${GIT_CRYPT_KEY_BASE64:-unset} = unset ]]; then
44            echo 'git-crypt key not present in environment'
45          else
46            git crypt unlock <(echo $GIT_CRYPT_KEY_BASE64 | base64 --decode)
47          fi
48      - run: echo "$(pwd)/bin" >> $GITHUB_PATH
49      - run: expotools ios-generate-dynamic-macros
50      - uses: ruby/setup-ruby@v1
51        with:
52          bundler-cache: true
53      - run: expotools client-build --platform ios
54        timeout-minutes: 120
55        env:
56          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
57          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
58      - name: Save test results
59        if: always()
60        uses: actions/upload-artifact@v2
61        with:
62          name: fastlane-logs
63          path: ~/Library/Logs/fastlane
64      - run: expotools client-build --platform ios --release # should only upload already-built app
65        if: ${{ github.event.inputs.releaseSimulator == 'release-simulator' }}
66        env:
67          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
68          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
69          EXPO_VERSIONS_SECRET: ${{ secrets.EXPO_VERSIONS_SECRET }}
70      - uses: 8398a7/action-slack@v3
71        if: failure() && (github.event.ref == 'refs/heads/master' || startsWith(github.event.ref, 'refs/heads/sdk-'))
72        env:
73          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74          SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_ios }}
75        with:
76          channel: '#platform-ios'
77          status: custom
78          fields: author,commit,ref,workflow
79          custom_payload: |
80            {
81              username: 'github-actions',
82              icon_emoji: ':octocat:',
83              attachments: [{
84                color: 'danger',
85                text: `${process.env.AS_WORKFLOW}@${process.env.AS_REF} failed: ${process.env.AS_COMMIT} by ${process.env.AS_AUTHOR}`,
86              }]
87            }
88