Skip to content

Commit

Permalink
feat: add qa env
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillermo Machado committed Aug 5, 2024
1 parent 303435f commit 63d3feb
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/actions/eas-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ name: 'Setup EAS Build + Trigger Build'
description: 'Setup EAS Build + Trigger Build'
inputs:
APP_ENV:
description: 'APP_ENV (one of): development, staging, production'
description: 'APP_ENV (one of): development, staging, production, qa'
required: true
default: 'staging'
AUTO_SUBMIT: ## TODO: we need to handle this too
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/eas-build-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: ⏱️ EAS Build
uses: ./.github/actions/eas-build
with:
APP_ENV: staging
APP_ENV: qa
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
VERSION: ${{ github.event.release.tag_name }}
IOS: false # TODO: set as true when IOS account is ready
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/eas-build-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 🔗 Links:
# Source file: https://github.com/obytes/react-native-template-obytes/blob/master/.github/workflows/eas-build-qa.yml
# Starter releasing process: https://starter.obytes.com/ci-cd/app-releasing-process/

# ✍️ Description:
# This workflow is used to trigger a build on EAS for the Staging environment.
# It will run on every GitHub release published on the repo or can be triggered manually from the actions tab.
# This workflow will use ./actions/eas-build action to trigger the build on EAS with staging env.

# 🚨 GITHUB SECRETS REQUIRED:
# - EXPO_TOKEN: Expo token to authenticate with EAS
# - You can get it from https://expo.dev/settings/access-tokens

name: EAS Staging Build (Android & IOS) (EAS)

on:
workflow_dispatch:
release:
types: [published]

jobs:
Build:
name: EAS Staging Build (Android & IOS) (EAS)
runs-on: ubuntu-latest
steps:
- name: Check for EXPO_TOKEN
run: |
if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then
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"
exit 1
fi
- name: 📦 Checkout project repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: 📦 Setup Node + PNPM + install deps
uses: ./.github/actions/setup-node-pnpm-install

- name: ⏱️ EAS Build
uses: ./.github/actions/eas-build
with:
APP_ENV: staging
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
VERSION: ${{ github.event.release.tag_name }}
IOS: false # TODO: set as true when IOS account is ready

22 changes: 22 additions & 0 deletions eas.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,28 @@
"key": "eas-1"
}
},
"qa": {
"channel": "qa",
"distribution": "internal",
"pnpm": "8.15.4",
"ios": {
"image": "latest"
},
"android": {
"buildType": "apk",
"image": "latest"
},
"env": {
"APP_ENV": "qa",
"EXPO_NO_DOTENV": "1",
"FLIPPER_DISABLE": "1"
},

"prebuildCommand": "prebuild --skip-dependency-update react",
"cache": {
"key": "eas-1"
}
},
"development": {
"developmentClient": true,
"distribution": "internal",
Expand Down
2 changes: 1 addition & 1 deletion env.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const withEnvSuffix = (name) => {
*/

const client = z.object({
APP_ENV: z.enum(['development', 'staging', 'production']),
APP_ENV: z.enum(['development', 'staging', 'production', 'qa']),
NAME: z.string(),
SCHEME: z.string(),
BUNDLE_ID: z.string(),
Expand Down
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,23 @@
"doctor": "npx expo-doctor@latest",
"preinstall": "npx only-allow pnpm",
"start:staging": "cross-env APP_ENV=staging pnpm run start",
"start:qa": "cross-env APP_ENV=qa pnpm run start",
"prebuild:staging": "cross-env APP_ENV=staging pnpm run prebuild",
"prebuild:qa": "cross-env APP_ENV=qa pnpm run prebuild",
"android:staging": "cross-env APP_ENV=staging pnpm run android",
"android:qa": "cross-env APP_ENV=qa pnpm run android",
"ios:staging": "cross-env APP_ENV=staging pnpm run ios",
"ios:qa": "cross-env APP_ENV=qa pnpm run ios",
"start:production": "cross-env APP_ENV=production pnpm run start",
"prebuild:production": "cross-env APP_ENV=production pnpm run prebuild",
"android:production": "cross-env APP_ENV=production pnpm run android",
"ios:production": "cross-env APP_ENV=production pnpm run ios",
"build:development:ios": "cross-env APP_ENV=development EXPO_NO_DOTENV=1 eas build --profile development --platform ios",
"build:development:android": "cross-env APP_ENV=development EXPO_NO_DOTENV=1 eas build --profile development --platform android ",
"build:staging:ios": "cross-env APP_ENV=staging EXPO_NO_DOTENV=1 eas build --profile staging --platform ios",
"build:qa:ios": "cross-env APP_ENV=qa EXPO_NO_DOTENV=1 eas build --profile qa --platform ios",
"build:staging:android": "cross-env APP_ENV=staging EXPO_NO_DOTENV=1 eas build --profile staging --platform android ",
"build:qa:android": "cross-env APP_ENV=qa EXPO_NO_DOTENV=1 eas build --profile qa --platform android ",
"build:production:ios": "cross-env APP_ENV=production EXPO_NO_DOTENV=1 eas build --profile production --platform ios",
"build:production:android": "cross-env APP_ENV=production EXPO_NO_DOTENV=1 eas build --profile production --platform android ",
"postinstall": "husky install",
Expand Down

0 comments on commit 63d3feb

Please sign in to comment.