Skip to content

Commit 4c584b1

Browse files
authored
Merge pull request #87 from rootstrap/docs/eas_update_eas_build_submit_instructions
docs(eas): update EAS build & submit instructions
2 parents 58c8dc1 + e33a661 commit 4c584b1

File tree

5 files changed

+362
-263
lines changed

5 files changed

+362
-263
lines changed

EAS.md

Lines changed: 81 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,109 @@
1-
## Distribute using Expo Application Services
1+
# Distribute using Expo Application Services
22

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.
44

5-
### Build from github actions
5+
## Application build process
66

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
88

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:
1010

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`
1319

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:
1521

16-
### Submit to Google Play Store
22+
a. Running the `eas build` command in your terminal for the required environment:
1723

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`
1932

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.
2134

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).
2336

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.
2538

26-
### Submit to AppStore
39+
### Building locally
2740

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:
2942

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`
3151

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`).
3353

34-
When asked `What do you want to do?` select: `App Store Connect: Manage your API Key`.
54+
## Application Distribution Process
3555

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
3757

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).
3959

40-
![Screenshot 2024-07-31 at 5 34 56 PM](https://github.com/user-attachments/assets/890e1199-b4c6-4aed-9582-3122d40ee66a)
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
4174

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:
4376

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`
4585

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.
4793

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+
![Screenshot 2024-07-31 at 5 34 56 PM](https://github.com/user-attachments/assets/890e1199-b4c6-4aed-9582-3122d40ee66a)
5095

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:
5297

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`
54106

55107
### Additional Resources
56108

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.

docs/src/content/docs/ci-cd/app-releasing-process.mdx

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Releasing your app to the App Store and Google Play or even to your QA team for
1212

1313
Doing this in a weekly basis requires automating the process as much as possible to gain time and avoid a lot of manual work.
1414

15-
To make this process as easy as possible, we use Github action and expo eas to build and release our app to the App Store and Google Play.
15+
To make this process as easy as possible, we use Github action and Expo EAS to build and release our app to the App Store and Google Play Store.
1616

1717
## The Philosophy
1818

@@ -67,52 +67,7 @@ In conclusion, when you want to release a new QA version, manually execute `new-
6767

6868
## Setup Release Process to your app
6969

70-
To setup the release process to your app, you need to follow these steps:
71-
72-
### Run Build Locally
73-
74-
First, make sure to create an [Expo](expo.dev) account then create a new organization for your project.
75-
76-
When then name of your organization is ready, you need to update the `EXPO_ACCOUNT_OWNER` variable in `env.js` file with the name of your organization.
77-
78-
**For QA release:**
79-
80-
```bash
81-
pnpm run prebuild:staging
82-
```
83-
84-
The above command will regenerate the iOS and Android folders based on the `staging` configuration.
85-
86-
Then run the following command to build the app using EAS:
87-
88-
:::caution
89-
You need to be logged in to EAS using `eas login` command before running this command. check [step 1 and 2 from EAS docs](https://docs.expo.dev/build/setup/) for more details.
90-
:::
91-
92-
```bash
93-
pnpm run build:staging:ios
94-
pnpm run build:staging:android
95-
```
96-
97-
The above commands will generate the required credentials for the build and store them in EAS servers so that we can use them later to trigger the build from GitHub actions.
98-
99-
**For production release:**
100-
101-
```bash
102-
pnpm run prebuild:production
103-
pnpm run build:production:ios
104-
pnpm run build:production:android
105-
```
106-
107-
In case you want to submit the app to the App Store and Google Play, you need to check eas submit configuration and follow the steps from [EAS docs](https://docs.expo.dev/submit/introduction/).
108-
109-
### Setup GitHub Actions
110-
111-
All github workflows are already ready to be used in the starter. You just need to add the required secrets to your GitHub repo:
112-
113-
- GH_TOKEN: A [Github token](https://github.com/settings/tokens) with access to your repo.
114-
115-
- EXPO_TOKEN: Expo token to authenticate with EAS. You can get generate yours [here](https://expo.dev/settings/access-tokens)
70+
To setup the release process for your app, you need to follow the steps from our [EAS instructions file](https://github.com/rootstrap/react-native-template/blob/master/EAS.md).
11671

11772
## Create new release
11873

env.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,13 @@ const withEnvSuffix = (name) =>
116116
*
117117
*/
118118

119+
// eslint-disable-next-line no-unused-vars, unused-imports/no-unused-vars
119120
const parseString = (/** @type {string | undefined} */ value) =>
120121
value === '' ? undefined : value;
122+
// eslint-disable-next-line no-unused-vars, unused-imports/no-unused-vars
121123
const parseNumber = (/** @type {string | undefined} */ value) =>
122124
value ? Number(value) : undefined;
125+
// eslint-disable-next-line no-unused-vars, unused-imports/no-unused-vars
123126
const parseBoolean = (/** @type {string | undefined} */ value) =>
124127
value ? value === 'true' : undefined;
125128

package.json

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@
1414
"build:development:android": "cross-env APP_ENV=development EXPO_NO_DOTENV=1 eas build --profile development --platform android ",
1515
"build:development:ios": "cross-env APP_ENV=development EXPO_NO_DOTENV=1 eas build --profile development --platform ios",
1616
"build:development:web": "cross-env APP_ENV=development EXPO_NO_DOTENV=1 expo export -c --platform web",
17+
"credentials:development:ios": "APP_ENV=development eas credentials:configure-build --profile=development --platform ios",
18+
"submit:development:mobile": "cross-env APP_ENV=development eas submit",
19+
"start:qa": "cross-env APP_ENV=qa pnpm run start",
20+
"prebuild:qa": "cross-env APP_ENV=qa pnpm run prebuild",
21+
"android:qa": "cross-env APP_ENV=qa pnpm run android",
22+
"ios:qa": "cross-env APP_ENV=qa pnpm run ios",
23+
"web:qa": "cross-env APP_ENV=qa pnpm run web",
24+
"build:qa:android": "cross-env APP_ENV=qa EXPO_NO_DOTENV=1 eas build --profile qa --platform android ",
25+
"build:qa:ios": "cross-env APP_ENV=qa EXPO_NO_DOTENV=1 eas build --profile qa --platform ios",
26+
"build:qa:web": "cross-env APP_ENV=qa EXPO_NO_DOTENV=1 expo export -c --platform web",
27+
"credentials:qa:ios": "APP_ENV=qa eas credentials:configure-build --profile=qa --platform ios",
28+
"submit:qa:mobile": "cross-env APP_ENV=qa eas submit",
1729
"start:staging": "cross-env APP_ENV=staging pnpm run start",
1830
"prebuild:staging": "cross-env APP_ENV=staging pnpm run prebuild",
1931
"android:staging": "cross-env APP_ENV=staging pnpm run android",
@@ -22,23 +34,19 @@
2234
"build:staging:android": "cross-env APP_ENV=staging EXPO_NO_DOTENV=1 eas build --profile staging --platform android ",
2335
"build:staging:ios": "cross-env APP_ENV=staging EXPO_NO_DOTENV=1 eas build --profile staging --platform ios",
2436
"build:staging:web": "cross-env APP_ENV=staging EXPO_NO_DOTENV=1 expo export -c --platform web",
25-
"start:qa": "cross-env APP_ENV=qa pnpm run start",
26-
"prebuild:qa": "cross-env APP_ENV=qa pnpm run prebuild",
27-
"android:qa": "cross-env APP_ENV=qa pnpm run android",
28-
"ios:qa": "cross-env APP_ENV=qa pnpm run ios",
29-
"web:qa": "cross-env APP_ENV=qa pnpm run web",
30-
"build:qa:ios": "cross-env APP_ENV=qa EXPO_NO_DOTENV=1 eas build --profile qa --platform ios",
31-
"build:qa:android": "cross-env APP_ENV=qa EXPO_NO_DOTENV=1 eas build --profile qa --platform android ",
32-
"build:qa:web": "cross-env APP_ENV=qa EXPO_NO_DOTENV=1 expo export -c --platform web",
37+
"credentials:staging:ios": "APP_ENV=staging eas credentials:configure-build --profile=staging --platform ios",
38+
"submit:staging:mobile": "cross-env APP_ENV=staging eas submit",
3339
"start:production": "cross-env APP_ENV=production pnpm run start",
3440
"prebuild:production": "cross-env APP_ENV=production pnpm run prebuild",
3541
"android:production": "cross-env APP_ENV=production pnpm run android",
3642
"ios:production": "cross-env APP_ENV=production pnpm run ios",
3743
"web:production": "cross-env APP_ENV=production pnpm run web",
3844
"build:production:android": "cross-env APP_ENV=production EXPO_NO_DOTENV=1 eas build --profile production --platform android ",
39-
"prepare": "husky",
4045
"build:production:ios": "cross-env APP_ENV=production EXPO_NO_DOTENV=1 eas build --profile production --platform ios",
4146
"build:production:web": "cross-env APP_ENV=production EXPO_NO_DOTENV=1 expo export -c --platform web",
47+
"credentials:production:ios": "APP_ENV=production eas credentials:configure-build --profile=production --platform ios",
48+
"submit:production:mobile": "cross-env APP_ENV=production eas submit",
49+
"prepare": "husky",
4250
"xcode": "xed -b ios",
4351
"doctor": "npx expo-doctor@latest",
4452
"preinstall": "npx only-allow pnpm",
@@ -62,18 +70,18 @@
6270
"@tanstack/react-query": "^5.52.1",
6371
"app-icon-badge": "^0.0.15",
6472
"axios": "^1.7.5",
65-
"expo": "~51.0.31",
73+
"expo": "~51.0.39",
6674
"expo-constants": "~16.0.2",
67-
"expo-dev-client": "~4.0.26",
75+
"expo-dev-client": "~4.0.29",
6876
"expo-font": "~12.0.10",
69-
"expo-image": "~1.12.15",
77+
"expo-image": "~1.13.0",
7078
"expo-linking": "~6.3.1",
7179
"expo-localization": "~15.0.3",
72-
"expo-router": "~3.5.23",
73-
"expo-splash-screen": "0.27.5",
80+
"expo-router": "~3.5.24",
81+
"expo-splash-screen": "0.27.7",
7482
"expo-status-bar": "~1.12.1",
7583
"expo-system-ui": "~3.0.7",
76-
"expo-updates": "~0.25.24",
84+
"expo-updates": "~0.25.27",
7785
"i18next": "^23.14.0",
7886
"lodash.memoize": "^4.1.2",
7987
"moti": "^0.29.0",

0 commit comments

Comments
 (0)