Skip to content

Commit

Permalink
Merge branch 'master' into chore/remove-env-files
Browse files Browse the repository at this point in the history
  • Loading branch information
juanchoperezj committed Aug 5, 2024
2 parents b47a37d + fccce7b commit b349e83
Show file tree
Hide file tree
Showing 56 changed files with 735 additions and 507 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: SonarQube analysis

on:
pull_request:
types: [opened, synchronize]
push:
branches:
- main
- master
- staging
- qa
- development

jobs:
sonar:
runs-on: ubuntu-latest
steps:
- 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: Run Tests
run: export NODE_OPTIONS=--experimental-vm-modules && pnpm test:ci

- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_URL }}
with:
args: >
-Dsonar.sonar.sources=./src
-Dsonar.qualitygate.wait=true
-Dsonar.projectBaseDir=.
-Dsonar.verbose=false
-Dsonar.projectKey=${{ secrets.SONAR_PROJECT }}
-Dsonar.sonar.sourceEncoding=UTF-8
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
-Dsonar.coverage.exclusions=**/storage/**,**/**.config.js,**/*.test.tsx,**/icons/**,**/docs/**,**/cli/**,**/__mocks__/**,**/android/**,**/ios/**
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ npm-debug.*
web-build/
yarn-error.log
/coverage

.env.**


# macOS
.DS_Store

Expand Down
50 changes: 50 additions & 0 deletions EAS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
## Distribute using Expo Application Services

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.

### Build from github actions

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

### Submit to Google Play Store

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.

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.

Once you've completed the guide you'll be able to submit to the store your EAS builds using the following command:

`eas submit --platform android`

### Submit to AppStore

1. Ensure your credentials are configured correctly in EAS. You can do this by running the following command in your terminal:

`eas credentials`

Follow the prompts to authenticate and select your Apple Developer account.

When asked `What do you want to do?` select: `App Store Connect: Manage your API Key`.

<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">

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

![Screenshot 2024-07-31 at 5 34 56 PM](https://github.com/user-attachments/assets/890e1199-b4c6-4aed-9582-3122d40ee66a)

2. Build your app using Expo and EAS:

`eas build --platform ios`

This command initiates the build process for iOS using Expo Application Services.

3. Submit Your Build to the App Store
Once your build is complete, you can submit it to the App Store using the following command:

`eas submit --platform ios`

This command will handle the submission of your build to the App Store using the credentials and configuration you provided.

### Additional Resources

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.
5 changes: 5 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
```

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

## ✍️ Documentation

- [Rules and Conventions](https://starter.obytes.com/getting-started/rules-and-conventions/)
Expand All @@ -47,3 +51,4 @@ pnpm android
- [Forms](https://starter.obytes.com/ui-and-theme/Forms)
- [Data fetching](https://starter.obytes.com/guides/data-fetching)
- [Contribute to starter](https://starter.obytes.com/how-to-contribute/)
- [Distribute using EAS](/EAS.md)
6 changes: 3 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ android {
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion

namespace 'com.obytes.development'
namespace 'com.rs.mobile.development'
defaultConfig {
applicationId 'com.obytes.development'
applicationId 'com.rs.mobile.development'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "6.1.0"
versionName "1.0.1"
}
signingConfigs {
debug {
Expand Down
2 changes: 2 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
<data android:scheme="obytesApp"/>
<data android:scheme="com.obytes.development"/>
<data android:scheme="exp+obytesapp"/>
<data android:scheme="react-native-template"/>
<data android:scheme="com.rs.mobile.development"/>
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.obytes.development
package com.rs.mobile.development

import android.os.Build
import android.os.Bundle
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.obytes.development
package com.rs.mobile.development

import android.app.Application
import android.content.res.Configuration
Expand Down
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<resources>
<string name="app_name">ObytesApp</string>
<string name="app_name">react-native-template</string>
<string name="expo_splash_screen_resize_mode" translatable="false">cover</string>
<string name="expo_splash_screen_status_bar_translucent" translatable="false">false</string>
<string name="expo_system_ui_user_interface_style" translatable="false">automatic</string>
Expand Down
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rootProject.name = 'ObytesApp'
rootProject.name = 'react-native-template'

dependencyResolutionManagement {
versionCatalogs {
Expand Down
10 changes: 5 additions & 5 deletions env.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ require('dotenv').config({

// TODO: Replace these values with your own

const BUNDLE_ID = 'com.obytes'; // ios bundle id
const PACKAGE = 'com.obytes'; // android package name
const NAME = 'ObytesApp'; // app name
const EXPO_ACCOUNT_OWNER = 'obytes'; // expo account owner
const BUNDLE_ID = 'com.rs.mobile'; // ios bundle id
const PACKAGE = 'com.rs.mobile'; // android package name
const NAME = 'react-native-template'; // app name
const EXPO_ACCOUNT_OWNER = 'rsdevs'; // expo account owner
const EAS_PROJECT_ID = 'c3e1075b-6fe7-4686-aa49-35b46a229044'; // eas project id
const SCHEME = 'obytesApp'; // app scheme
const SCHEME = 'react-native-template'; // app scheme

/**
* We declare a function withEnvSuffix that will add a suffix to the variable name based on the APP_ENV
Expand Down
2 changes: 1 addition & 1 deletion ios/ObytesApp.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
2 changes: 1 addition & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ install! 'cocoapods',

prepare_react_native_project!

target 'ObytesApp' do
target 'ReactNativeTemplate' do
use_expo_modules!
config = use_native_modules!

Expand Down
Loading

0 comments on commit b349e83

Please sign in to comment.