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