1name: iOS Client 2 3on: 4 workflow_dispatch: 5 inputs: 6 releaseSimulator: 7 description: 'type "release-simulator" to confirm upload' 8 required: false 9 schedule: 10 - cron: '20 5 * * 1,3,5' # 5:20 AM UTC time on every Monday, Wednesday and Friday 11 pull_request: 12 paths: 13 - .github/workflows/client-ios.yml 14 - ios/** 15 - tools/src/dynamic-macros/** 16 - tools/src/commands/IosGenerateDynamicMacros.ts 17 - tools/src/client-build/** 18 - tools/src/commands/ClientBuild.ts 19 - secrets/** 20 - fastlane/** 21 - Gemfile.lock 22 - .ruby-version 23 - yarn.lock 24 push: 25 branches: [main, sdk-*] 26 paths: 27 - .github/workflows/client-ios.yml 28 - ios/** 29 - tools/src/dynamic-macros/** 30 - tools/src/commands/IosGenerateDynamicMacros.ts 31 - tools/src/client-build/** 32 - tools/src/commands/ClientBuild.ts 33 - secrets/** 34 - fastlane/** 35 - Gemfile.lock 36 - .ruby-version 37 - yarn.lock 38 39concurrency: 40 group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} 41 cancel-in-progress: true 42 43jobs: 44 build: 45 runs-on: macos-11 46 steps: 47 - name: Checkout a ref for the event 48 uses: actions/checkout@v2 49 with: 50 submodules: true 51 - name: Switch to Xcode 13.0 52 run: sudo xcode-select --switch /Applications/Xcode_13.0.app 53 - name: Setup Homebrew 54 run: brew install git-crypt 55 - name: decrypt secrets if possible 56 env: 57 GIT_CRYPT_KEY_BASE64: ${{ secrets.GIT_CRYPT_KEY_BASE64 }} 58 run: | 59 if [[ ${GIT_CRYPT_KEY_BASE64:-unset} = unset ]]; then 60 echo 'git-crypt key not present in environment' 61 else 62 git crypt unlock <(echo $GIT_CRYPT_KEY_BASE64 | base64 --decode) 63 fi 64 - run: echo "$(pwd)/bin" >> $GITHUB_PATH 65 - name: ♻️ Restore workspace node modules 66 uses: actions/cache@v2 67 id: node-modules-cache 68 with: 69 path: | 70 # See "workspaces" → "packages" in the root package.json for the source of truth of 71 # which node_modules are affected by the root yarn.lock 72 node_modules 73 apps/*/node_modules 74 home/node_modules 75 packages/*/node_modules 76 packages/@expo/*/node_modules 77 packages/@unimodules/*/node_modules 78 react-native-lab/react-native/node_modules 79 key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} 80 - name: Yarn install 81 run: yarn install --frozen-lockfile 82 - name: ♻️ Restore node modules in tools 83 uses: actions/cache@v2 84 with: 85 path: tools/node_modules 86 key: ${{ runner.os }}-tools-modules-${{ hashFiles('tools/yarn.lock') }} 87 - name: Generating dynamic macros 88 run: expotools ios-generate-dynamic-macros 89 - name: Setup Ruby and install gems 90 uses: ruby/setup-ruby@v1 91 with: 92 bundler-cache: true 93 - name: ♻️ Restore ios/Pods from cache 94 uses: actions/cache@v2 95 with: 96 path: 'ios/Pods' 97 key: ${{ runner.os }}-pods-${{ hashFiles('ios/Podfile.lock') }} 98 # restore-keys: | 99 # ${{ runner.os }}-pods- 100 - name: Install CocoaPods in `ios` 101 run: pod install 102 working-directory: ios 103 - name: Check which flavor to build 104 id: flavor 105 uses: dorny/paths-filter@v2 106 with: 107 # this action fails when base is not set on schedule event 108 base: ${{ github.ref }} 109 filters: | 110 versioned: 111 - ios/versioned-react-native/** 112 - ios/Exponent/Versioned/** 113 - name: Build Expo Go for simulator 114 run: | 115 [[ "$IS_VERSIONED_FLAVOR" == "true" ]] && FLAVOR="versioned" || FLAVOR="unversioned" 116 echo "Building with $FLAVOR flavor" 117 expotools client-build --platform ios --flavor $FLAVOR 118 timeout-minutes: 120 119 env: 120 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} 121 AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 122 IS_VERSIONED_FLAVOR: ${{ github.event_name == 'schedule' || steps.flavor.outputs.versioned == 'true' }} 123 - name: Save test results 124 if: always() 125 uses: actions/upload-artifact@v2 126 with: 127 name: fastlane-logs 128 path: ~/Library/Logs/fastlane 129 - name: Build Expo Go for simulator 130 run: expotools client-build --platform ios --release # should only upload already-built app 131 if: ${{ github.event.inputs.releaseSimulator == 'release-simulator' }} 132 env: 133 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} 134 AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 135 EXPO_VERSIONS_SECRET: ${{ secrets.EXPO_VERSIONS_SECRET }} 136 - name: Notify on Slack 137 uses: 8398a7/action-slack@v3 138 if: failure() && (github.event.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/heads/sdk-')) 139 env: 140 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 141 SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_ios }} 142 with: 143 channel: '#expo-ios' 144 status: ${{ job.status }} 145 fields: job,message,ref,eventName,author,took 146 author_name: Expo Go (iOS) 147