1name: Versioning Expo Go 2 3on: 4 workflow_dispatch: {} 5 schedule: 6 - cron: '0 5 * * SUN' # 5am UTC time on each Sunday 7 pull_request: 8 paths: 9 - .github/workflows/versioning.yml 10 - tools/src/commands/AddSDKVersion.ts 11 - tools/src/commands/RemoveSDKVersion.ts 12 - tools/src/versioning/** 13 14concurrency: 15 group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} 16 cancel-in-progress: true 17 18jobs: 19 ios: 20 runs-on: macos-11 21 steps: 22 - name: Checkout a ref for the event 23 uses: actions/checkout@v2 24 with: 25 submodules: true 26 - name: Switch to Xcode 12.5.1 27 run: sudo xcode-select --switch /Applications/Xcode_12.5.1.app 28 - name: Setup Homebrew 29 run: brew install git-crypt 30 - name: decrypt secrets if possible 31 env: 32 GIT_CRYPT_KEY_BASE64: ${{ secrets.GIT_CRYPT_KEY_BASE64 }} 33 run: | 34 if [[ ${GIT_CRYPT_KEY_BASE64:-unset} = unset ]]; then 35 echo 'git-crypt key not present in environment' 36 else 37 git crypt unlock <(echo $GIT_CRYPT_KEY_BASE64 | base64 --decode) 38 fi 39 - name: ➕ Add `bin` to GITHUB_PATH 40 run: echo "$(pwd)/bin" >> $GITHUB_PATH 41 - name: ♻️ Restore workspace node modules 42 uses: actions/cache@v2 43 id: node-modules-cache 44 with: 45 path: | 46 # See "workspaces" → "packages" in the root package.json for the source of truth of 47 # which node_modules are affected by the root yarn.lock 48 node_modules 49 apps/*/node_modules 50 home/node_modules 51 packages/*/node_modules 52 packages/@unimodules/*/node_modules 53 react-native-lab/react-native/node_modules 54 key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} 55 - name: Yarn install 56 run: yarn install --frozen-lockfile 57 - name: ♻️ Restore node modules in tools 58 uses: actions/cache@v2 59 with: 60 path: tools/node_modules 61 key: ${{ runner.os }}-tools-modules-${{ hashFiles('tools/yarn.lock') }} 62 - name: Generating dynamic macros 63 run: expotools ios-generate-dynamic-macros 64 - name: Setup Ruby and install gems 65 uses: ruby/setup-ruby@v1 66 with: 67 bundler-cache: true 68 - name: ♻️ Restore ios/Pods from cache 69 uses: actions/cache@v2 70 with: 71 path: 'ios/Pods' 72 key: ${{ runner.os }}-pods-${{ hashFiles('ios/Podfile.lock') }} 73 restore-keys: | 74 ${{ runner.os }}-pods- 75 - name: Install CocoaPods in `ios` 76 run: pod install 77 working-directory: ios 78 - name: Adding new SDK version 79 run: expotools add-sdk-version --platform ios --sdkVersion next --reinstall 80 - name: Build versioned Expo Go for simulator 81 run: expotools client-build --platform ios --flavor versioned 82 timeout-minutes: 120 83 env: 84 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} 85 AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 86 - name: Removing SDK version 87 run: expotools remove-sdk-version --platform ios --sdkVersion latest 88 - name: Git working dir is clean 89 run: git diff --exit-code 90 - name: Notify on Slack 91 uses: 8398a7/action-slack@v3 92 if: failure() && (github.event.ref == 'refs/heads/master' || startsWith(github.event.ref, 'refs/heads/sdk-')) 93 env: 94 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 95 SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_ios }} 96 with: 97 channel: '#platform-ios' 98 status: ${{ job.status }} 99 fields: job,message,ref,eventName,author,took 100 author_name: Versioning Expo Go (iOS) 101