Skip to content

Commit bd9f890

Browse files
Merge pull request #25 from rootstrap/feat/add-qa-env
feat: add qa env
2 parents 395d488 + af871ce commit bd9f890

File tree

8 files changed

+166
-101
lines changed

8 files changed

+166
-101
lines changed

.github/actions/eas-build/action.yml

Lines changed: 0 additions & 85 deletions
This file was deleted.

.github/workflows/eas-build-qa.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: ⏱️ EAS Build
4141
uses: ./.github/actions/eas-build
4242
with:
43-
APP_ENV: staging
43+
APP_ENV: qa
4444
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
4545
VERSION: ${{ github.event.release.tag_name }}
4646
IOS: false # TODO: set as true when IOS account is ready
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# 🔗 Links:
2+
# Source file: https://github.com/obytes/react-native-template-obytes/blob/master/.github/workflows/eas-build-qa.yml
3+
# Starter releasing process: https://starter.obytes.com/ci-cd/app-releasing-process/
4+
5+
# ✍️ Description:
6+
# This workflow is used to trigger a build on EAS for the Staging environment.
7+
# It will run on every GitHub release published on the repo or can be triggered manually from the actions tab.
8+
# This workflow will use ./actions/eas-build action to trigger the build on EAS with staging env.
9+
10+
# 🚨 GITHUB SECRETS REQUIRED:
11+
# - EXPO_TOKEN: Expo token to authenticate with EAS
12+
# - You can get it from https://expo.dev/settings/access-tokens
13+
14+
name: EAS Staging Build (Android & IOS) (EAS)
15+
16+
on:
17+
workflow_dispatch:
18+
release:
19+
types: [published]
20+
21+
jobs:
22+
Build:
23+
name: EAS Staging Build (Android & IOS) (EAS)
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Check for EXPO_TOKEN
27+
run: |
28+
if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then
29+
echo "You must provide an EXPO_TOKEN secret linked to this project's Expo account in this repo's secrets. Learn more: https://docs.expo.dev/eas-update/github-actions"
30+
exit 1
31+
fi
32+
- name: 📦 Checkout project repo
33+
uses: actions/checkout@v3
34+
with:
35+
fetch-depth: 0
36+
37+
- name: 📦 Setup Node + PNPM + install deps
38+
uses: ./.github/actions/setup-node-pnpm-install
39+
40+
- name: ⏱️ EAS Build
41+
uses: ./.github/actions/eas-build
42+
with:
43+
APP_ENV: staging
44+
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
45+
VERSION: ${{ github.event.release.tag_name }}
46+
IOS: false # TODO: set as true when IOS account is ready
47+

.github/workflows/eas-build.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# 🔗 Links:
2+
# Source file: https://github.com/rootstrap/react-native-template/blob/master/.github/actions/eas-build/action.yml
3+
# EAS Build docs: https://docs.expo.dev/eas-update/github-actions/
4+
5+
# ✍️ Description:
6+
# This is a composite action, which means it can be used in other actions.
7+
# This action is used to trigger an EAS Build for a specific environment (development, staging, production).
8+
# This action accepts those inputs:
9+
# `APP_ENV`, which is used to generate an APK for a specific environment (development, staging, production). We use staging by default.
10+
# `AUTO_SUBMIT`, false by default, set to true if you want to automatically submit your build to stores.
11+
# `EXPO_TOKEN`, required, access token for your Expo account. https://expo.dev/settings/access-tokens
12+
# `VERSION`, required, version of the app to build. used as the build message.
13+
# `ANDROID`, true by default, set to true if you don't want to trigger build for Android.
14+
# `IOS`, false by default, set to true if you want to trigger build for IOS.
15+
16+
# Before triggering the build, we run a pre-build script to generate the necessary native folders based on the APP_ENV.
17+
# Based on the ANDROID and IOS inputs, we trigger the build for the corresponding platform with the corresponding flags.
18+
19+
# 👀 Example usage:
20+
# - name: ⏱️ EAS Build
21+
# uses: ./.github/actions/eas-build
22+
# with:
23+
# environment: staging
24+
# EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
25+
# VERSION: ${{ github.event.release.tag_name }}
26+
# IOS: false
27+
28+
name: 'Setup EAS Build + Trigger Build'
29+
30+
on:
31+
workflow_dispatch:
32+
inputs:
33+
environment:
34+
type: choice
35+
description: 'environment (one of): development, staging, production'
36+
required: true
37+
default: 'staging'
38+
options:
39+
- development
40+
- staging
41+
- production
42+
43+
jobs:
44+
Build:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Check for EXPO_TOKEN
48+
run: |
49+
if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then
50+
echo "You must provide an EXPO_TOKEN secret linked to this project's Expo account in this repo's secrets. Learn more: https://docs.expo.dev/eas-update/github-actions"
51+
exit 1
52+
fi
53+
54+
- name: 📦 Setup Expo and EAS
55+
uses: expo/expo-github-action@v8
56+
with:
57+
eas-version: latest
58+
token: ${{ secrets.EXPO_TOKEN }}
59+
60+
- name: 📦 Checkout project repo
61+
uses: actions/checkout@v3
62+
with:
63+
fetch-depth: 0
64+
65+
- name: 📦 Setup Node + PNPM + install deps
66+
uses: ./.github/actions/setup-node-pnpm-install
67+
68+
- name: ⚙️ Run Prebuild
69+
run: pnpm prebuild:${{ inputs.environment }}
70+
71+
- name: 📱 Run Android Build
72+
run: pnpm build:${{ inputs.environment }}:android --non-interactive --no-wait --message "Build ${{ inputs.environment }}"
73+
74+
- name: 📱 Run IOS Build
75+
run: pnpm build:${{ inputs.environment }}:ios --non-interactive --no-wait --message "Build ${{ inputs.environment }}"

eas.json

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
},
2727
"staging": {
2828
"channel": "staging",
29-
"distribution": "internal",
29+
"distribution": "store",
3030
"pnpm": "8.15.4",
3131
"ios": {
3232
"image": "latest"
@@ -45,6 +45,28 @@
4545
"key": "eas-1"
4646
}
4747
},
48+
"qa": {
49+
"channel": "qa",
50+
"distribution": "store",
51+
"pnpm": "8.15.4",
52+
"ios": {
53+
"image": "latest"
54+
},
55+
"android": {
56+
"buildType": "apk",
57+
"image": "latest"
58+
},
59+
"env": {
60+
"APP_ENV": "qa",
61+
"EXPO_NO_DOTENV": "1",
62+
"FLIPPER_DISABLE": "1"
63+
},
64+
65+
"prebuildCommand": "prebuild --skip-dependency-update react",
66+
"cache": {
67+
"key": "eas-1"
68+
}
69+
},
4870
"development": {
4971
"developmentClient": true,
5072
"distribution": "internal",

env.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ const parseBoolean = (/** @type {string | undefined} */ value) =>
107107
value ? value === 'true' : undefined;
108108

109109
const clientEnvSchema = z.object({
110-
APP_ENV: z.enum(['development', 'staging', 'production']),
110+
APP_ENV: z.enum(['development', 'production', 'qa', 'staging']),
111111
NAME: z.string(),
112112
SCHEME: z.string(),
113113
BUNDLE_ID: z.string(),

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,23 @@
1212
"doctor": "npx expo-doctor@latest",
1313
"preinstall": "npx only-allow pnpm",
1414
"start:staging": "cross-env APP_ENV=staging pnpm run start",
15+
"start:qa": "cross-env APP_ENV=qa pnpm run start",
1516
"prebuild:staging": "cross-env APP_ENV=staging pnpm run prebuild",
17+
"prebuild:qa": "cross-env APP_ENV=qa pnpm run prebuild",
1618
"android:staging": "cross-env APP_ENV=staging pnpm run android",
19+
"android:qa": "cross-env APP_ENV=qa pnpm run android",
1720
"ios:staging": "cross-env APP_ENV=staging pnpm run ios",
21+
"ios:qa": "cross-env APP_ENV=qa pnpm run ios",
1822
"start:production": "cross-env APP_ENV=production pnpm run start",
1923
"prebuild:production": "cross-env APP_ENV=production pnpm run prebuild",
2024
"android:production": "cross-env APP_ENV=production pnpm run android",
2125
"ios:production": "cross-env APP_ENV=production pnpm run ios",
2226
"build:development:ios": "cross-env APP_ENV=development EXPO_NO_DOTENV=1 eas build --profile development --platform ios",
2327
"build:development:android": "cross-env APP_ENV=development EXPO_NO_DOTENV=1 eas build --profile development --platform android ",
2428
"build:staging:ios": "cross-env APP_ENV=staging EXPO_NO_DOTENV=1 eas build --profile staging --platform ios",
29+
"build:qa:ios": "cross-env APP_ENV=qa EXPO_NO_DOTENV=1 eas build --profile qa --platform ios",
2530
"build:staging:android": "cross-env APP_ENV=staging EXPO_NO_DOTENV=1 eas build --profile staging --platform android ",
31+
"build:qa:android": "cross-env APP_ENV=qa EXPO_NO_DOTENV=1 eas build --profile qa --platform android ",
2632
"build:production:ios": "cross-env APP_ENV=production EXPO_NO_DOTENV=1 eas build --profile production --platform ios",
2733
"build:production:android": "cross-env APP_ENV=production EXPO_NO_DOTENV=1 eas build --profile production --platform android ",
2834
"postinstall": "husky install",
@@ -50,8 +56,8 @@
5056
"axios": "^1.7.1",
5157
"expo": "~51.0.31",
5258
"expo-constants": "~16.0.2",
53-
"expo-dev-client": "~4.0.25",
54-
"expo-font": "~12.0.9",
59+
"expo-dev-client": "~4.0.26",
60+
"expo-font": "~12.0.10",
5561
"expo-image": "~1.12.15",
5662
"expo-linking": "~6.3.1",
5763
"expo-localization": "~15.0.3",

pnpm-lock.yaml

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)