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