name: iOS Client on: workflow_dispatch: inputs: releaseSimulator: description: 'type "release-simulator" to confirm upload' required: false schedule: - cron: '20 5 * * 1,3,5' # 5:20 AM UTC time on every Monday, Wednesday and Friday pull_request: paths: - .github/workflows/client-ios.yml - ios/** - tools/** - secrets/** - fastlane/** - Gemfile.lock - .ruby-version push: branches: [master, sdk-*] paths: - .github/workflows/client-ios.yml - ios/** - tools/** - secrets/** - fastlane/** - Gemfile.lock - .ruby-version concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} cancel-in-progress: true jobs: build: runs-on: macos-11 steps: - name: ๐Ÿ‘€ Checkout a ref for the event 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 Homebrew run: brew install git-crypt - name: ๐Ÿ”“ decrypt secrets if possible env: GIT_CRYPT_KEY_BASE64: ${{ secrets.GIT_CRYPT_KEY_BASE64 }} run: | if [[ ${GIT_CRYPT_KEY_BASE64:-unset} = unset ]]; then echo 'git-crypt key not present in environment' else git crypt unlock <(echo $GIT_CRYPT_KEY_BASE64 | base64 --decode) fi - run: echo "$(pwd)/bin" >> $GITHUB_PATH - 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 node modules in tools uses: actions/cache@v2 with: path: tools/node_modules key: ${{ runner.os }}-tools-modules-${{ hashFiles('tools/yarn.lock') }} - name: ๐Ÿญ Generating dynamic macros run: expotools ios-generate-dynamic-macros - name: ๐Ÿ’Ž Setup Ruby and install gems uses: ruby/setup-ruby@v1 with: bundler-cache: true - name: โ™ป๏ธ Restore ios/Pods from cache uses: actions/cache@v2 with: path: 'ios/Pods' key: ${{ runner.os }}-pods-${{ hashFiles('ios/Podfile.lock') }} restore-keys: | ${{ runner.os }}-pods- - name: ๐Ÿฅฅ Install CocoaPods in `ios` run: pod install working-directory: ios - name: ๐Ÿ”Ž Check which flavor to build id: flavor uses: dorny/paths-filter@v2 with: # this action fails when base is not set on schedule event base: ${{ github.ref }} filters: | versioned: - ios/versioned-react-native/** - ios/Exponent/Versioned/** - name: ๐Ÿ— Build Expo Go for simulator run: | [[ "$IS_VERSIONED_FLAVOR" == "true" ]] && FLAVOR="versioned" || FLAVOR="unversioned" echo "Building with $FLAVOR flavor" expotools client-build --platform ios --flavor $FLAVOR timeout-minutes: 120 env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} IS_VERSIONED_FLAVOR: ${{ github.event_name == 'schedule' || steps.flavor.outputs.versioned == 'true' }} - name: ๐Ÿ’พ Save test results if: always() uses: actions/upload-artifact@v2 with: name: fastlane-logs path: ~/Library/Logs/fastlane - name: ๐Ÿ— Build Expo Go for simulator run: expotools client-build --platform ios --release # should only upload already-built app if: ${{ github.event.inputs.releaseSimulator == 'release-simulator' }} env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} EXPO_VERSIONS_SECRET: ${{ secrets.EXPO_VERSIONS_SECRET }} - name: ๐Ÿ”” Notify on Slack uses: 8398a7/action-slack@v3 if: failure() && (github.event.ref == 'refs/heads/master' || startsWith(github.event.ref, 'refs/heads/sdk-')) 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: Expo Go (iOS)