xref: /expo/.github/workflows/shell-app-ios.yml (revision 4e758f24)
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-10.15
24    steps:
25      - uses: actions/checkout@v2
26        with:
27          submodules: true
28      - name: �� Switch to Xcode 12.1
29        run: sudo xcode-select --switch /Applications/Xcode_12.1.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 tools/node_modules from cache
39        uses: actions/cache@v2
40        with:
41          path: 'tools/node_modules'
42          key: ${{ runner.os }}-modules-${{ hashFiles('tools/yarn.lock') }}
43      - name: �� Generate dynamic macros
44        run: expotools ios-generate-dynamic-macros
45      - name: �� Build iOS shell app for real devices
46        timeout-minutes: 30
47        run: expotools ios-shell-app --action build --type archive --verbose true --skipRepoUpdate --shellAppSdkVersion UNVERSIONED
48      - name: �� Build iOS shell app for simulators
49        timeout-minutes: 30
50        run: expotools ios-shell-app --action build --type simulator --verbose true --skipRepoUpdate --shellAppSdkVersion UNVERSIONED
51      - name: ✏️ Set tarball name
52        id: tarball
53        run: echo "::set-output name=filename::ios-shell-builder-sdk-latest-${{ github.sha }}.tar.gz"
54      - name: �� Package release tarball
55        run: |
56          tar \
57            -zcf ${{ steps.tarball.outputs.filename }} \
58            package.json \
59            exponent-view-template \
60            shellAppBase-builds \
61            shellAppWorkspaces \
62            ios
63      - name: �� Upload shell app tarball to S3
64        if: ${{ github.event.inputs.upload == 'upload' }}
65        timeout-minutes: 40
66        env:
67          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
68          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
69        run: |
70          aws s3 cp --acl public-read ${{ steps.tarball.outputs.filename }} s3://exp-artifacts
71          echo "Release tarball uploaded to s3://exp-artifacts/${{ steps.tarball.outputs.filename }}"
72          echo "You can deploy this by updating or creating a new file in https://github.com/expo/turtle/tree/master/shellTarballs/ios"
73          echo "Then follow the deployment instructions: https://github.com/expo/turtle-deploy"
74      - name: �� Notify on Slack
75        uses: 8398a7/action-slack@v3
76        if: failure() && (github.event.ref == 'refs/heads/master' || startsWith(github.event.ref, 'refs/heads/sdk-') || github.event_name == 'schedule')
77        env:
78          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_IOS }}
80        with:
81          channel: '#platform-ios'
82          status: ${{ job.status }}
83          fields: job,message,ref,eventName,author,took
84          author_name: Shell App (iOS)
85