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