使用 EAS Workflows 部署到生产环境
了解如何使用 EAS Workflows 部署到生产环境。
当你准备好向用户提供更改时,你可以构建并提交到应用商店,也可以发送无线更新。以下工作流程检测你是否需要新构建,如果需要,它会将它们发送到应用商店。如果不需要新版本,它将发送无线更新。
¥When you're ready to deliver changes to your users, you can build and submit to the app stores or you can send an over-the-air update. The following workflow detects if you need new builds, and if so, it sends them to the app stores. If new builds are not required, it will send an over-the-air update.

开始使用
¥Get started
3 requirements
3 requirements
1.
Set up EAS Build
要设置 EAS Build,请遵循以下指南:
¥To set up EAS Build, follow this guide:
Get your project ready for EAS Build.
2.
Set up EAS Submit
要设置 EAS Submit,请遵循 Google Play Store 和 Apple App Store 提交指南:
¥To set up EAS Submit, follow the Google Play Store and Apple App Store submissions guides:
Get your project ready for Google Play Store submissions.
Get your project ready for Apple App Store submissions.
3.
Set up EAS Update
最后,你需要设置 EAS 更新,你可以使用以下方法执行此操作:
¥And finally, you'll need to set up EAS Update, which you can do with:
-
eas update:configure
以下工作流程在每次推送到 main
分支时运行并执行以下操作:
¥The following workflow runs on each push to the main
branch and performs the following:
-
使用 Expo 指纹 对项目的原生特性进行哈希处理。
¥Takes a hash of the native characteristics of the project using Expo Fingerprint.
-
检查指纹是否已存在构建。
¥Checks if a build already exists for the fingerprint.
-
如果构建不存在,它将构建项目并将其提交到应用商店。
¥If a build does not exist, it will build the project and submit it to the app stores.
-
如果构建存在,它将发送无线更新。
¥If a build exists, it will send an over-the-air update.
name: Deploy to production on: push: branches: ['main'] jobs: fingerprint: name: Fingerprint type: fingerprint get_android_build: name: Check for existing android build needs: [fingerprint] type: get-build params: fingerprint_hash: ${{ needs.fingerprint.outputs.android_fingerprint_hash }} profile: production get_ios_build: name: Check for existing ios build needs: [fingerprint] type: get-build params: fingerprint_hash: ${{ needs.fingerprint.outputs.ios_fingerprint_hash }} profile: production build_android: name: Build Android needs: [get_android_build] if: ${{ !needs.get_android_build.outputs.build_id }} type: build params: platform: android profile: production build_ios: name: Build iOS needs: [get_ios_build] if: ${{ !needs.get_ios_build.outputs.build_id }} type: build params: platform: ios profile: production submit_android_build: name: Submit Android Build needs: [build_android] type: submit params: build_id: ${{ needs.build_android.outputs.build_id }} submit_ios_build: name: Submit iOS Build needs: [build_ios] type: submit params: build_id: ${{ needs.build_ios.outputs.build_id }} publish_android_update: name: Publish Android update needs: [get_android_build] if: ${{ needs.get_android_build.outputs.build_id }} type: update params: branch: production platform: android publish_ios_update: name: Publish iOS update needs: [get_ios_build] if: ${{ needs.get_ios_build.outputs.build_id }} type: update params: branch: production platform: ios