1name: iOS Client 2 3on: 4 workflow_dispatch: 5 inputs: 6 releaseSimulator: 7 description: 'type "release-simulator" to confirm upload' 8 required: false 9 pull_request: 10 paths: 11 - .github/workflows/client-ios.yml 12 - ios/** 13 - tools/** 14 - secrets/** 15 - fastlane/** 16 - Gemfile.lock 17 - .ruby-version 18 push: 19 branches: [master, sdk-*] 20 paths: 21 - .github/workflows/client-ios.yml 22 - ios/** 23 - tools/** 24 - secrets/** 25 - fastlane/** 26 - Gemfile.lock 27 - .ruby-version 28 29jobs: 30 build: 31 runs-on: macos-10.15 32 steps: 33 - uses: actions/checkout@v2 34 with: 35 submodules: true 36 - run: brew install git-crypt 37 - name: decrypt secrets if possible 38 env: 39 GIT_CRYPT_KEY_BASE64: ${{ secrets.GIT_CRYPT_KEY_BASE64 }} 40 run: | 41 if [[ ${GIT_CRYPT_KEY_BASE64:-unset} = unset ]]; then 42 echo 'git-crypt key not present in environment' 43 else 44 git crypt unlock <(echo $GIT_CRYPT_KEY_BASE64 | base64 --decode) 45 fi 46 - run: echo "$(pwd)/bin" >> $GITHUB_PATH 47 - name: Get yarn cache directory path 48 id: yarn-cache-dir-path 49 run: echo "::set-output name=dir::$(yarn cache dir)" 50 - name: ♻️ Restore yarn cache 51 uses: actions/cache@v2 52 with: 53 path: ${{ steps.yarn-cache-dir-path.outputs.dir }} 54 key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} 55 restore-keys: | 56 ${{ runner.os }}-yarn- 57 - name: Yarn install 58 run: yarn install --frozen-lockfile 59 - name: ♻️ Restore tools/node_modules from cache 60 uses: actions/cache@v2 61 with: 62 path: 'tools/node_modules' 63 key: ${{ runner.os }}-modules-${{ hashFiles('tools/yarn.lock') }} 64 - run: expotools ios-generate-dynamic-macros 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 - run: expotools client-build --platform ios 79 timeout-minutes: 120 80 env: 81 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} 82 AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 83 - name: Save test results 84 if: always() 85 uses: actions/upload-artifact@v2 86 with: 87 name: fastlane-logs 88 path: ~/Library/Logs/fastlane 89 - run: expotools client-build --platform ios --release # should only upload already-built app 90 if: ${{ github.event.inputs.releaseSimulator == 'release-simulator' }} 91 env: 92 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} 93 AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 94 EXPO_VERSIONS_SECRET: ${{ secrets.EXPO_VERSIONS_SECRET }} 95 - name: Notify on Slack 96 uses: 8398a7/action-slack@v3 97 if: failure() && (github.event.ref == 'refs/heads/master' || startsWith(github.event.ref, 'refs/heads/sdk-')) 98 env: 99 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 100 SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_ios }} 101 with: 102 channel: '#platform-ios' 103 status: ${{ job.status }} 104 fields: job,commit,ref,eventName,author,took 105 author_name: Expo Go (iOS) 106