xref: /expo/.github/workflows/shell-app-ios.yml (revision fc12ed2d)
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' # 5:20 AM UTC time on every Tuesday, Thursday and Saturday
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      - name: �� Checkout
26        uses: actions/checkout@v3
27        with:
28          submodules: true
29      - name: �� Switch to Xcode 13.0
30        run: sudo xcode-select --switch /Applications/Xcode_13.0.app
31      - name: ➕ Add `EXPO_ROOT_DIR` to GITHUB_ENV
32        run: echo "EXPO_ROOT_DIR=$(pwd)" >> $GITHUB_ENV
33      - name: ➕ Add `bin` to GITHUB_PATH
34        run: echo "$(pwd)/bin" >> $GITHUB_PATH
35      - name: �� Setup Ruby and install gems
36        uses: ruby/setup-ruby@v1
37        with:
38          bundler-cache: true
39      - name: ♻️ Restore caches
40        uses: ./.github/actions/expo-caches
41        id: expo-caches
42        with:
43          yarn-workspace: 'true'
44          yarn-tools: 'true'
45      - name: �� Yarn install
46        if: steps.expo-caches.outputs.yarn-workspace-hit != 'true'
47        run: yarn install --frozen-lockfile
48      - name: �� Generate dynamic macros
49        run: expotools ios-generate-dynamic-macros
50      - name: �� Build iOS shell app for real devices
51        timeout-minutes: 30
52        run: |
53          expotools ios-shell-app --action build --type archive --verbose true --skipRepoUpdate --shellAppSdkVersion UNVERSIONED
54      - name: �� Build iOS shell app for simulators
55        timeout-minutes: 30
56        run: |
57          expotools ios-shell-app --action build --type simulator --verbose true --skipRepoUpdate --shellAppSdkVersion UNVERSIONED
58      - name: ✏️ Set tarball name
59        id: tarball
60        run: echo "::set-output name=filename::ios-shell-builder-sdk-latest-${{ github.sha }}.tar.gz"
61      - name: �� Package release tarball
62        run: |
63          tar \
64            -zcf ${{ steps.tarball.outputs.filename }} \
65            package.json \
66            exponent-view-template \
67            shellAppBase-builds \
68            shellAppWorkspaces \
69            ios
70      - name: �� Upload shell app tarball to S3
71        if: ${{ github.event.inputs.upload == 'upload' }}
72        timeout-minutes: 40
73        env:
74          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
75          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
76          AWS_DEFAULT_REGION: 'us-east-1'
77        run: |
78          aws s3 cp --acl public-read ${{ steps.tarball.outputs.filename }} s3://exp-artifacts
79          echo "Release tarball uploaded to s3://exp-artifacts/${{ steps.tarball.outputs.filename }}"
80          echo "You can deploy this by updating or creating a new file in https://github.com/expo/turtle/tree/main/shellTarballs/ios"
81          echo "Then follow the deployment instructions: https://github.com/expo/turtle-deploy"
82      - name: �� Notify on Slack
83        uses: 8398a7/action-slack@v3
84        if: failure() && (github.event.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/heads/sdk-') || github.event_name == 'schedule')
85        env:
86          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_IOS }}
88        with:
89          channel: '#expo-ios'
90          status: ${{ job.status }}
91          fields: job,message,ref,eventName,author,took
92          author_name: Shell App (iOS)
93