xref: /expo/.github/workflows/shell-app-ios.yml (revision 665c2bac)
1name: iOS Shell App
2
3on:
4  workflow_dispatch:
5    inputs:
6      upload:
7        description: 'type "upload" to confirm upload to S3'
8        required: false
9  schedule:
10    - cron: '20 5 * * 2,4,6'
11  pull_request:
12    paths:
13      - .github/workflows/shell-app-ios.yml
14      - .ruby-version
15      - exponent-view-template
16
17concurrency:
18  group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
19  cancel-in-progress: true
20
21jobs:
22  build:
23    runs-on: macos-11
24    steps:
25      - uses: actions/checkout@v2
26        with:
27          submodules: true
28      - name: �� Switch to Xcode 13.0
29        run: sudo xcode-select --switch /Applications/Xcode_13.0.app
30      - name: �� Setup
31        run: |
32          echo "$(pwd)/bin" >> $GITHUB_PATH
33          echo "EXPO_ROOT_DIR=$(pwd)" >> $GITHUB_ENV
34      - name: �� Setup Ruby and install gems
35        uses: ruby/setup-ruby@v1
36        with:
37          bundler-cache: true
38      - name: ♻️ Restore workspace node modules
39        uses: actions/cache@v2
40        id: node-modules-cache
41        with:
42          path: |
43            # See "workspaces" → "packages" in the root package.json for the source of truth of
44            # which node_modules are affected by the root yarn.lock
45            node_modules
46            apps/*/node_modules
47            home/node_modules
48            packages/*/node_modules
49            packages/@unimodules/*/node_modules
50            react-native-lab/react-native/node_modules
51          key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
52      - name: �� Yarn install
53        run: yarn install --frozen-lockfile
54      - name: ♻️ Restore tools/node_modules from cache
55        uses: actions/cache@v2
56        with:
57          path: 'tools/node_modules'
58          key: ${{ runner.os }}-modules-${{ hashFiles('tools/yarn.lock') }}
59      - name: �� Generate dynamic macros
60        run: expotools ios-generate-dynamic-macros
61      - name: �� Build iOS shell app for real devices
62        timeout-minutes: 30
63        run: |
64          expotools ios-shell-app --action build --type archive --verbose true --skipRepoUpdate --shellAppSdkVersion UNVERSIONED
65      - name: �� Build iOS shell app for simulators
66        timeout-minutes: 30
67        run: |
68          expotools ios-shell-app --action build --type simulator --verbose true --skipRepoUpdate --shellAppSdkVersion UNVERSIONED
69      - name: ✏️ Set tarball name
70        id: tarball
71        run: echo "::set-output name=filename::ios-shell-builder-sdk-latest-${{ github.sha }}.tar.gz"
72      - name: �� Package release tarball
73        run: |
74          tar \
75            -zcf ${{ steps.tarball.outputs.filename }} \
76            package.json \
77            exponent-view-template \
78            shellAppBase-builds \
79            shellAppWorkspaces \
80            ios
81      - name: �� Upload shell app tarball to S3
82        if: ${{ github.event.inputs.upload == 'upload' }}
83        timeout-minutes: 40
84        env:
85          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
86          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
87        run: |
88          aws s3 cp --acl public-read ${{ steps.tarball.outputs.filename }} s3://exp-artifacts
89          echo "Release tarball uploaded to s3://exp-artifacts/${{ steps.tarball.outputs.filename }}"
90          echo "You can deploy this by updating or creating a new file in https://github.com/expo/turtle/tree/master/shellTarballs/ios"
91          echo "Then follow the deployment instructions: https://github.com/expo/turtle-deploy"
92      - name: �� Notify on Slack
93        uses: 8398a7/action-slack@v3
94        if: failure() && (github.event.ref == 'refs/heads/master' || startsWith(github.event.ref, 'refs/heads/sdk-') || github.event_name == 'schedule')
95        env:
96          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_IOS }}
98        with:
99          channel: '#platform-ios'
100          status: ${{ job.status }}
101          fields: job,message,ref,eventName,author,took
102          author_name: Shell App (iOS)
103