xref: /expo/.github/workflows/client-ios.yml (revision 0fd9a914)
1name: iOS Client
2
3on:
4  repository_dispatch:
5    types: [ release-simulator ]
6  pull_request:
7    branches: [ master ]
8    paths:
9      - .github/workflows/client-ios.yml
10      - ios/**
11      - tools/expotools/**
12      - secrets/**
13      - fastlane/**
14      - Gemfile.lock
15      - .ruby-version
16  push:
17    branches: [ master, sdk-* ]
18    paths:
19      - .github/workflows/client-ios.yml
20      - ios/**
21      - tools/expotools/**
22      - secrets/**
23      - fastlane/**
24      - Gemfile.lock
25      - .ruby-version
26
27jobs:
28  build:
29    runs-on: macos-10.15
30    steps:
31      - uses: actions/checkout@v2
32        with:
33          submodules: true
34          lfs: true
35      - run: brew install git-crypt
36      - name: decrypt secrets if possible
37        env:
38          GIT_CRYPT_KEY_BASE64: ${{ secrets.GIT_CRYPT_KEY_BASE64 }}
39        run: |
40          if [[ ${GIT_CRYPT_KEY_BASE64:-unset} = unset ]]; then
41            echo 'git-crypt key not present in environment'
42          else
43            git crypt unlock <(echo $GIT_CRYPT_KEY_BASE64 | base64 --decode)
44          fi
45      - run: bin/expotools ios-generate-dynamic-macros
46      - uses: ruby/setup-ruby@v1
47      - name: bundler cache
48        uses: actions/cache@v1
49        with:
50          path: vendor/bundle
51          key: ${{ runner.os }}-gems-${{ hashFiles('.ruby-version') }}-${{ hashFiles('Gemfile.lock') }}
52          restore-keys: |
53            ${{ runner.os }}-gems-
54      - run: echo "::set-env name=BUNDLE_BIN::$(pwd)/.direnv/bin"
55      - run: echo "::add-path::$BUNDLE_BIN"
56      - name: install fastlane
57        run: |
58          bundle config path vendor/bundle
59          bundle install --jobs 4 --retry 3
60      - run: fastlane ios create_simulator_build
61        timeout-minutes: 60
62      - name: Save test results
63        if: always()
64        uses: actions/upload-artifact@v2
65        with:
66          name: fastlane-logs
67          path: ~/Library/Logs/fastlane
68      - run: expotools client-build --platform ios --release
69        if: ${{ github.event.action == 'release-simulator' }}
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: ${{ job.status }}
78          fields: commit,author,action,message
79          author_name: client ios build
80