|
1 | | -## Distribute using Expo Application Services |
| 1 | +# Distribute using Expo Application Services |
2 | 2 |
|
3 | | -To be able to use Expo Application Services to upload your app to App Store and Google Play Store there are some configurations that need to be done on your side. |
| 3 | +To use Expo Application Services (EAS) to build and upload your app to the App Store and Google Play Store, there are some configurations that need to be set up on your side. |
4 | 4 |
|
5 | | -### Build from github actions |
| 5 | +## Application build process |
6 | 6 |
|
7 | | -To be able to trigger the eas-build github action you will have to add the `EXPO_TOKEN` secret to the repo settings. This secret is a required access token for your Expo account. https://expo.dev/settings/access-tokens |
| 7 | +### Building with EAS |
8 | 8 |
|
9 | | -You will also have to upload your envfiles to EAS secrets: |
| 9 | +You will need to upload each environment file as a **file-type** EAS secret: |
10 | 10 |
|
11 | | -`eas secret:create --scope project --name ENVIRONMENT_FILE_PRODUCTION --value .env.production --type file` |
12 | | -`eas secret:create --scope project --name ENVIRONMENT_FILE_STAGING --value .env.staging --type file` |
| 11 | +- For the Development environment: |
| 12 | + - `eas secret:create --scope project --name ENVIRONMENT_FILE_DEVELOPMENT --value .env.development --type file` |
| 13 | +- For the QA environment: |
| 14 | + - `eas secret:create --scope project --name ENVIRONMENT_FILE_QA --value .env.qa --type file` |
| 15 | +- For the Staging environment: |
| 16 | + - `eas secret:create --scope project --name ENVIRONMENT_FILE_STAGING --value .env.staging --type file` |
| 17 | +- For the Production environment: |
| 18 | + - `eas secret:create --scope project --name ENVIRONMENT_FILE_PRODUCTION --value .env.production --type file` |
13 | 19 |
|
14 | | -Each one per environment you'll want to build, it's on [env.js](env.js) that the process looks for the right envfile depending on where the build is being run and the chosen environment. |
| 20 | +Then, there are two ways to start a build process using EAS: |
15 | 21 |
|
16 | | -### Submit to Google Play Store |
| 22 | +a. Running the `eas build` command in your terminal for the required environment: |
17 | 23 |
|
18 | | -The first submission of the app needs to be performed manually. Learn more: https://expo.fyi/first-android-submission. Only after having a valid version submitted you can submit automatically using EAS. |
| 24 | +- For the Development environment: |
| 25 | + - `pnpm build:development:android` and `pnpm build:development:ios` |
| 26 | +- For the QA environment: |
| 27 | + - `pnpm build:qa:android` and `pnpm build:qa:ios` |
| 28 | +- For the Staging environment: |
| 29 | + - `pnpm build:staging:android` and `pnpm build:staging:ios` |
| 30 | +- For the Production environment: |
| 31 | + - `pnpm build:production:android` and `pnpm build:production:ios` |
19 | 32 |
|
20 | | -To submit an app to google play store you will have to follow the steps in [Uploading a Google Service Account Key for Play Store Submissions with EAS](https://github.com/expo/fyi/blob/main/creating-google-service-account.md) guide, its super detailed and should not take you much time. |
| 33 | +b. Manually triggering the [EAS Build workflow](.github/workflows/eas-build.yml) from the repository's Actions tab. |
21 | 34 |
|
22 | | -Once you've completed the guide you'll be able to submit to the store your EAS builds using the following command: |
| 35 | +For the workflow to work properly, you will need to add the `EXPO_TOKEN` secret in the repository settings. This secret is a required access token for your Expo account. To generate a new token, follow the steps in the official [Expo documentation](https://expo.dev/settings/access-tokens). |
23 | 36 |
|
24 | | -`eas submit --platform android` |
| 37 | +After you've added the secrets, you can trigger the build by manually running the [EAS Build workflow](.github/workflows/eas-build.yml) from the repository's Actions tab. |
25 | 38 |
|
26 | | -### Submit to AppStore |
| 39 | +### Building locally |
27 | 40 |
|
28 | | -1. Ensure your credentials are configured correctly in EAS. You can do this by running the following command in your terminal: |
| 41 | +You can also run a local build by executing the following commands: |
29 | 42 |
|
30 | | -`eas credentials` |
| 43 | +- For the Development environment: |
| 44 | + - `pnpm build:development:android --local` and `pnpm build:development:ios --local` |
| 45 | +- For the QA environment: |
| 46 | + - `pnpm build:qa:android --local` and `pnpm build:qa:ios --local` |
| 47 | +- For the Staging environment: |
| 48 | + - `pnpm build:staging:android --local` and `pnpm build:staging:ios --local` |
| 49 | +- For the Production environment: |
| 50 | + - `pnpm build:production:android --local` and `pnpm build:production:ios --local` |
31 | 51 |
|
32 | | -Follow the prompts to authenticate and select your Apple Developer account. |
| 52 | +The only prerequisite is to have the corresponding environment file in the root folder of the project (`.env.development`, `.env.qa`, `.env.staging` or `.env.production`). |
33 | 53 |
|
34 | | -When asked `What do you want to do?` select: `App Store Connect: Manage your API Key`. |
| 54 | +## Application Distribution Process |
35 | 55 |
|
36 | | -<img width="793" alt="Screenshot 2024-07-31 at 6 09 59 PM" src="https://github.com/user-attachments/assets/c0403c6d-b151-4d74-9458-2b6fadd6cbf3"> |
| 56 | +### Submit to the Google Play Store |
37 | 57 |
|
38 | | -In order to be able to Generate a new App Store Connect API Key it's important your user has the right permissions on the App Store Connect account. Make sure you have access to Cloud Managed Distribution Certificate, if you don't have this permission you'll get a `403 - Access forbidden response`. |
| 58 | +The first submission of the app needs to be done manually. To learn more about why this is required, refer to the [official Expo documentation](https://expo.fyi/first-android-submission). |
39 | 59 |
|
40 | | - |
| 60 | +To submit an app to the Google Play Store, follow the steps in the [Uploading a Google Service Account Key for Play Store Submissions with EAS](https://github.com/expo/fyi/blob/main/creating-google-service-account.md) guide. It is detailed and should not take much time. |
| 61 | + |
| 62 | +Once you've completed the guide, you'll be able to submit your EAS builds to the Google Play Store using the following commands: |
| 63 | + |
| 64 | +- For the Development environment: |
| 65 | + - `pnpm submit:development:mobile --platform android` |
| 66 | +- For the QA environment: |
| 67 | + - `pnpm submit:qa:mobile --platform android` |
| 68 | +- For the Staging environment: |
| 69 | + - `pnpm submit:staging:mobile --platform android` |
| 70 | +- For the Production environment: |
| 71 | + - `pnpm submit:production:mobile --platform android` |
| 72 | + |
| 73 | +### Submit to the App Store |
41 | 74 |
|
42 | | -2. Build your app using Expo and EAS: |
| 75 | +First, ensure your credentials are configured correctly in EAS. Do this by running the following commands in your terminal: |
43 | 76 |
|
44 | | -`eas build --platform ios` |
| 77 | +- For the Development environment: |
| 78 | + - `pnpm credentials:development:ios` |
| 79 | +- For the QA environment: |
| 80 | + - `pnpm credentials:qa:ios` |
| 81 | +- For the Staging environment: |
| 82 | + - `pnpm credentials:staging:ios` |
| 83 | +- For the Production environment: |
| 84 | + - `pnpm credentials:production:ios` |
45 | 85 |
|
46 | | -This command initiates the build process for iOS using Expo Application Services. |
| 86 | +Follow the prompts to authenticate and select your Apple Developer account. |
| 87 | + |
| 88 | +When asked, "What do you want to do?", select: `App Store Connect: Manage your API Key`. |
| 89 | + |
| 90 | +<img width="793" alt="Screenshot 2024-07-31 at 6 09 59 PM" src="https://github.com/user-attachments/assets/c0403c6d-b151-4d74-9458-2b6fadd6cbf3"> |
| 91 | + |
| 92 | +To generate a new App Store Connect API Key, ensure your user has the necessary permissions on the App Store Connect account. Verify that you have access to the Cloud Managed Distribution Certificate. Without this permission, you'll receive a `403 - Access forbidden response` error message. |
47 | 93 |
|
48 | | -3. Submit Your Build to the App Store |
49 | | - Once your build is complete, you can submit it to the App Store using the following command: |
| 94 | + |
50 | 95 |
|
51 | | -`eas submit --platform ios` |
| 96 | +Once you've configured the credentials in EAS, you'll be able to submit your builds to the App Store using the following commands: |
52 | 97 |
|
53 | | -This command will handle the submission of your build to the App Store using the credentials and configuration you provided. |
| 98 | +- For the Development environment: |
| 99 | + - `pnpm submit:development:mobile --platform ios` |
| 100 | +- For the QA environment: |
| 101 | + - `pnpm submit:qa:mobile --platform ios` |
| 102 | +- For the Staging environment: |
| 103 | + - `pnpm submit:staging:mobile --platform ios` |
| 104 | +- For the Production environment: |
| 105 | + - `pnpm submit:production:mobile --platform ios` |
54 | 106 |
|
55 | 107 | ### Additional Resources |
56 | 108 |
|
57 | | -For more detailed instructions on setting up your Apple Developer account, certificates, and provisioning profiles, refer to the [EAS Submits](https://docs.expo.dev/submit/introduction/) docs. |
| 109 | +For more detailed instructions on setting up your Apple Developer account, certificates, and provisioning profiles, refer to the [EAS Submit](https://docs.expo.dev/submit/introduction/) documentation. |
0 commit comments