Skip to content

Commit

Permalink
Merge pull request #26 from rootstrap/chore/eas
Browse files Browse the repository at this point in the history
Eas build --local
  • Loading branch information
fernandatoledo authored Aug 19, 2024
2 parents 393ddbb + b1fbfab commit 0a67402
Show file tree
Hide file tree
Showing 9 changed files with 425 additions and 266 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/expo-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ jobs:
name: Expo Doctor (expo)
runs-on: ubuntu-latest

env:
# Add your other environment variables here, e.g.:
API_URL: https://dummyjson.com/
SECRET_KEY: my-secret-key
VAR_NUMBER: 10
VAR_BOOL: true

steps:
- name: 📦 Checkout project repo
uses: actions/checkout@v3
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ yarn-error.log

# macOS
.DS_Store
*.apk
*.ipa


# @generated expo-cli sync-2b81b286409207a5da26e14c78851eb30d8ccbdb
Expand Down
4 changes: 4 additions & 0 deletions README-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ To run the app on Android
pnpm android
```

To build your app locally you can run any of the build scripts with --local.

`pnpm build:development:ios --local`

### SonarQube setup

SonarQube is an open-source platform for continuous inspection of code quality. It performs automatic reviews to detect bugs, code smells, and security vulnerabilities. Rootstrap has a SonarQube instance to improve the quality of the software we develop. On each PR, a GitHub Action is triggered to perform the analysis. To set up SonarQube correctly, you need to add the `SONAR_TOKEN`, `SONAR_URL`, and `SONAR_PROJECT` secrets to the repository. Additionally, you must select the quality gate named `ReactNativeTemplate` for your project on SonarQube. In case you're using this project outside Rootstrap and you're not planning to use SonarQube the sonar scanner [workflow](.github/workflows/sonar.yml) should be deleted.
Expand Down
6 changes: 5 additions & 1 deletion app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
description: `${Env.NAME} Mobile App`,
owner: Env.EXPO_ACCOUNT_OWNER,
scheme: Env.SCHEME,
slug: 'obytesapp',
slug: 'reactnativetemplate',
version: Env.VERSION.toString(),
orientation: 'portrait',
icon: './assets/icon.png',
Expand All @@ -21,6 +21,10 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
},
updates: {
fallbackToCacheTimeout: 0,
url: 'https://u.expo.dev/72fdf440-59f1-493d-96e3-4afad8d7a045',
},
runtimeVersion: {
policy: 'appVersion',
},
assetBundlePatterns: ['**/*'],
ios: {
Expand Down
8 changes: 4 additions & 4 deletions eas.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"EXPO_NO_DOTENV": "1",
"FLIPPER_DISABLE": "1"
},

"prebuildCommand": "prebuild --skip-dependency-update react",
"cache": {
"key": "eas-1"
Expand All @@ -60,11 +59,11 @@
"APP_ENV": "development",
"EXPO_NO_DOTENV": "1"
},

"prebuildCommand": "prebuild --skip-dependency-update react",
"cache": {
"key": "eas-1"
}
},
"channel": "development"
},
"simulator": {
"ios": {
Expand All @@ -82,7 +81,8 @@
"prebuildCommand": "prebuild --skip-dependency-update react",
"cache": {
"key": "eas-1"
}
},
"channel": "simulator"
}
},
"submit": {
Expand Down
6 changes: 3 additions & 3 deletions env.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ require('dotenv').config({
const BUNDLE_ID = 'com.rootstrap'; // ios bundle id
const PACKAGE = 'com.rootstrap'; // android package name
const NAME = 'RootstrapApp'; // app name
const EXPO_ACCOUNT_OWNER = 'rootstrap'; // expo account owner
const EAS_PROJECT_ID = 'c3e1075b-6fe7-4686-aa49-35b46a229044'; // eas project id
const SCHEME = 'rootstrapApp'; // app scheme
const EXPO_ACCOUNT_OWNER = 'rsdevs'; // expo account owner
const EAS_PROJECT_ID = '72fdf440-59f1-493d-96e3-4afad8d7a045'; // eas project id
const SCHEME = 'RootstrapApp'; // app scheme

/**
* We declare a function withEnvSuffix that will add a suffix to the variable name based on the APP_ENV
Expand Down
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
"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:staging:android": "cross-env APP_ENV=staging EXPO_NO_DOTENV=1 eas build --profile staging --platform android ",
"build:staging:ios:local": "cross-env APP_ENV=staging sh -c './scripts/set-env.sh EXPO_NO_DOTENV=1 eas build --profile staging --platform ios --local'",
"build:staging:android:local": "cross-env APP_ENV=staging sh -c './scripts/set-env.sh EXPO_NO_DOTENV=1 eas build --profile staging --platform android --local'",
"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 All @@ -37,7 +39,7 @@
"e2e-test": "maestro test .maestro/ -e APP_ID=com.obytes.development"
},
"dependencies": {
"@expo/metro-runtime": "^3.2.1",
"@expo/metro-runtime": "^3.2.3",
"@gorhom/bottom-sheet": "^4.6.3",
"@hookform/resolvers": "^2.9.11",
"@react-navigation/bottom-tabs": "^6.5.20",
Expand All @@ -47,18 +49,19 @@
"@tanstack/react-query": "^5.37.1",
"app-icon-badge": "^0.0.15",
"axios": "^1.7.1",
"expo": "~51.0.24",
"expo": "~51.0.28",
"expo-build-properties": "~0.12.4",
"expo-constants": "~16.0.2",
"expo-dev-client": "~4.0.21",
"expo-dev-client": "~4.0.23",
"expo-font": "~12.0.9",
"expo-image": "~1.12.13",
"expo-linking": "~6.3.1",
"expo-localization": "~15.0.3",
"expo-router": "~3.5.20",
"expo-router": "~3.5.23",
"expo-splash-screen": "0.27.5",
"expo-status-bar": "~1.12.1",
"expo-system-ui": "~3.0.7",
"expo-updates": "~0.25.21",
"i18next": "^22.5.1",
"lodash.memoize": "^4.1.2",
"moti": "^0.28.1",
Expand All @@ -68,7 +71,7 @@
"react-error-boundary": "^3.1.4",
"react-hook-form": "^7.51.4",
"react-i18next": "^12.3.1",
"react-native": "0.74.3",
"react-native": "0.74.5",
"react-native-avoid-softinput": "^4.0.2",
"react-native-flash-message": "^0.4.2",
"react-native-gesture-handler": "~2.16.2",
Expand Down
Loading

0 comments on commit 0a67402

Please sign in to comment.