name: iOS Shell App on: workflow_dispatch: inputs: upload: description: 'type "upload" to confirm upload to S3' required: false versioned: description: 'Create shell workspace from newest SDK versioned environment' required: false schedule: - cron: '20 5 * * 2,4,6' pull_request: paths: - .github/workflows/shell-app-ios.yml - .ruby-version - exponent-view-template concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} cancel-in-progress: true jobs: build: runs-on: macos-11 steps: - uses: actions/checkout@v2 with: submodules: true - name: ๐Ÿ”จ Switch to Xcode 12.5.1 run: sudo xcode-select --switch /Applications/Xcode_12.5.1.app - name: ๐Ÿบ Setup run: | echo "$(pwd)/bin" >> $GITHUB_PATH echo "EXPO_ROOT_DIR=$(pwd)" >> $GITHUB_ENV - name: ๐Ÿ’Ž Setup Ruby and install gems uses: ruby/setup-ruby@v1 with: bundler-cache: true - name: โ™ป๏ธ Restore workspace node modules uses: actions/cache@v2 id: node-modules-cache with: path: | # See "workspaces" โ†’ "packages" in the root package.json for the source of truth of # which node_modules are affected by the root yarn.lock node_modules apps/*/node_modules home/node_modules packages/*/node_modules packages/@unimodules/*/node_modules react-native-lab/react-native/node_modules key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} - name: ๐Ÿงถ Yarn install run: yarn install --frozen-lockfile - name: โ™ป๏ธ Restore tools/node_modules from cache uses: actions/cache@v2 with: path: 'tools/node_modules' key: ${{ runner.os }}-modules-${{ hashFiles('tools/yarn.lock') }} - name: ๐Ÿ Generate dynamic macros run: expotools ios-generate-dynamic-macros - name: ๐Ÿ“ฆ Build iOS shell app for real devices (versioned) if: ${{ github.event.inputs.versioned == 'true' }} timeout-minutes: 30 run: | expotools ios-shell-app --action build --type archive --verbose true --skipRepoUpdate --shellAppSdkVersion UNVERSIONED - name: ๐Ÿ“ฆ Build iOS shell app for simulators (versioned) if: ${{ github.event.inputs.versioned == 'true' }} timeout-minutes: 30 run: | expotools ios-shell-app --action build --type simulator --verbose true --skipRepoUpdate --shellAppSdkVersion UNVERSIONED - name: ๐Ÿ“ฆ Build iOS shell app for real devices (unversioned) if: ${{ github.event.inputs.versioned != 'true' }} timeout-minutes: 30 run: | expotools ios-shell-app --action build --type archive --verbose true --skipRepoUpdate --shellAppSdkVersion UNVERSIONED \ --packagesToInstallWhenEjecting '{"react-native": "file:../../react-native-lab/react-native", "react-native-unimodules": "file:../../packages/react-native-unimodules"}' - name: ๐Ÿ“ฆ Build iOS shell app for simulators (unversioned) if: ${{ github.event.inputs.versioned != 'true' }} timeout-minutes: 30 run: | expotools ios-shell-app --action build --type simulator --verbose true --skipRepoUpdate --shellAppSdkVersion UNVERSIONED \ --packagesToInstallWhenEjecting '{"react-native": "file:../../react-native-lab/react-native", "react-native-unimodules": "file:../../packages/react-native-unimodules"}' - name: โœ๏ธ Set tarball name id: tarball run: echo "::set-output name=filename::ios-shell-builder-sdk-latest-${{ github.sha }}.tar.gz" - name: ๐Ÿค Package release tarball run: | tar \ -zcf ${{ steps.tarball.outputs.filename }} \ package.json \ exponent-view-template \ shellAppBase-builds \ shellAppWorkspaces \ ios - name: ๐Ÿš€ Upload shell app tarball to S3 if: ${{ github.event.inputs.upload == 'upload' }} timeout-minutes: 40 env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} run: | aws s3 cp --acl public-read ${{ steps.tarball.outputs.filename }} s3://exp-artifacts echo "Release tarball uploaded to s3://exp-artifacts/${{ steps.tarball.outputs.filename }}" echo "You can deploy this by updating or creating a new file in https://github.com/expo/turtle/tree/master/shellTarballs/ios" echo "Then follow the deployment instructions: https://github.com/expo/turtle-deploy" - name: ๐Ÿ”” Notify on Slack uses: 8398a7/action-slack@v3 if: failure() && (github.event.ref == 'refs/heads/master' || startsWith(github.event.ref, 'refs/heads/sdk-') || github.event_name == 'schedule') env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_IOS }} with: channel: '#platform-ios' status: ${{ job.status }} fields: job,message,ref,eventName,author,took author_name: Shell App (iOS)