Skip to content

Commit

Permalink
Merge pull request #200 from mia-ajuda/215-EntregaContínua
Browse files Browse the repository at this point in the history
215 - Configuração da entrega contínua com EAS Submit
  • Loading branch information
RcleydsonR authored Aug 25, 2022
2 parents 1f5bc27 + 0a6cc35 commit e703da1
Show file tree
Hide file tree
Showing 58 changed files with 412 additions and 741 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/deploy.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:
cancel-in-progress: true

jobs:
deploy:
build-deploy:
runs-on: ubuntu-latest
defaults:
run:
Expand Down Expand Up @@ -51,6 +51,9 @@ jobs:
- name: 📦 Install dependencies
run: yarn install --pure-lockfile --non-interactive

- name: 📦 Run lint
run: yarn lint

- name: 📦 Publish staging
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
run: expo publish --release-channel=staging --non-interactive
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/submit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: submit app to play store


on :
push :
branches : [ master ]

jobs:
submit:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./app

steps:
- name: 🏗 Setup repo
uses: actions/checkout@v3

- name: 🏗 Setup node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
cache-dependency-path: app/yarn.lock

- name: 🏗 Config files
run: |
echo "$GOOGLE_SERVICES" > google-services.json
echo "$FIREBASE_CONFIG_DEV" > ./src/config/authmiaajuda-firebase-dev.json
echo "$FIREBASE_CONFIG" > ./src/config/authmiaajuda-firebase.json
echo "$ENV_VARIABLE" > .env
echo "$SERVICE_ACCOUNT_KEY" > ./serviceAccountKey.json
env:
GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }}
FIREBASE_CONFIG_DEV: ${{ secrets.FIREBASE_CONFIG_DEV }}
FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }}
ENV_VARIABLE: ${{ secrets.ENV_VARIABLE }}
SERVICE_ACCOUNT_KEY: ${{ secrets.SERVICE_ACCOUNT_KEY }}

- name: 🏗 Setup Expo and EAS
uses: expo/expo-github-action@v7
with:
expo-version: latest
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}

- name: 📦 Install dependencies
run: yarn install --pure-lockfile --non-interactive

- name: 📦 Build prod aab by expo build
run: expo build:android -t app-bundle --release-channel=prod --non-interactive

- name: 📦 Retrieve last build url version
run: echo "BUILD_URL=$(expo url:apk)" >> $GITHUB_ENV

- name: 📦 Submit latest aab build to play store as production app
run: eas submit -p android --url ${{ env.BUILD_URL }}
3 changes: 1 addition & 2 deletions app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import 'react-native-gesture-handler';
import React, { useEffect, useState } from 'react';
import Root from './src/index';
import loadFonts from './assets/fonts/loadFonts';
import { View, LogBox } from 'react-native';
import { AppRegistry } from 'react-native';
import { View, LogBox, AppRegistry } from 'react-native';

LogBox.ignoreLogs(['Unrecognized WebSocket']);

Expand Down
2 changes: 1 addition & 1 deletion app/app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default ({ config }) => {
apiKey: MAPS_API_KEY,
},
},
versionCode: 211,
versionCode: 220,
},
};
};
2 changes: 1 addition & 1 deletion app/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"color": "#4b8ab9",
"androidMode": "default"
},
"version": "2.1.0 Mutt",
"version": "2.2.0 Mutt",
"orientation": "portrait",
"icon": "./assets/images/logo.png",
"splash": {
Expand Down
19 changes: 19 additions & 0 deletions app/eas.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"cli": {
"version": ">= 0.57.0"
},
"submit": {
"production": {
"android": {
"serviceAccountKeyPath": "./serviceAccountKey.json",
"track": "production"
}
},
"alpha_test": {
"android": {
"serviceAccountKeyPath": "./serviceAccountKey.json",
"track": "alpha"
}
}
}
}
29 changes: 12 additions & 17 deletions app/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
const { getDefaultConfig } = require('metro-config');
const { getDefaultConfig } = require('expo/metro-config');

module.exports = (async () => {
const {
resolver: { sourceExts, assetExts },
} = await getDefaultConfig();
const config = getDefaultConfig(__dirname);

return {
transformer: {
babelTransformerPath: require.resolve(
'react-native-svg-transformer',
),
},
resolver: {
assetExts: assetExts.filter((ext) => ext !== 'svg'),
sourceExts: [...sourceExts, 'svg'],
},
};
})();
config.transformer.babelTransformerPath = require.resolve(
'react-native-svg-transformer',
);

config.resolver.assetExts = config.resolver.assetExts.filter(
(ext) => ext !== 'svg',
);
config.resolver.sourceExts = [...config.resolver.sourceExts, 'svg'];

module.exports = config;
3 changes: 3 additions & 0 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@
"@react-navigation/stack": "^5.2.9",
"axios": "^0.21.1",
"expo": "^45.0.0",
"expo-dev-client": "~1.0.1",
"expo-device": "~4.2.0",
"expo-facebook": "~12.2.0",
"expo-google-app-auth": "~8.3.0",
"expo-image-picker": "~13.1.1",
"expo-location": "~14.2.2",
"expo-notifications": "~0.15.4",
"expo-splash-screen": "~0.15.1",
"expo-system-ui": "~1.2.0",
"expo-updates": "~0.13.4",
"firebase": "8.2.3",
"jwt-decode": "^3.1.2",
Expand Down
2 changes: 1 addition & 1 deletion app/src/ExternalServices/ViaCep.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Viacep {
async getCepInformation(currentCep) {
const url = `https://viacep.com.br/ws/${currentCep}/json/`;
const cepInformation = await axios.get(url);
if (cepInformation.data.erro) throw { message: 'cep inválido' };
if (cepInformation.data.erro) throw new Error('cep inválido');
return cepInformation.data;
}
}
Expand Down
3 changes: 2 additions & 1 deletion app/src/Navigation/MainNavigation/BottomNavigator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const BottomTab = () => {
navigationIconsConfig(focused, route),
})}
initialRouteName="main"
backBehavior="initialRoute">
backBehavior="initialRoute"
>
<BottomNavigation.Screen
name="notification"
component={NotificationNavigation}
Expand Down
50 changes: 5 additions & 45 deletions app/src/components/FAQModals/EmergencyNumbersModal/index.js
Original file line number Diff line number Diff line change
@@ -1,53 +1,13 @@
import React from 'react';
import { Modal, ScrollView, TouchableOpacity, View, Text } from 'react-native';
import { Icon } from 'react-native-elements';
import Container from '../../Container';
import colors from '../../../../assets/styles/colorVariables';
import emergencyNumbers from '../../../docs/FAQ/EmergencyNumbers';
import styles from './styles';
import { ModalComponent } from '../modal';

export default function EmergencyNumbers({ visible, setVisible }) {
const renderEmergencyNumbersList = () => (
<View style={styles.modalContent}>
<ScrollView indicatorStyle="white">
{emergencyNumbers.map((numbers) => {
return (
<View key={numbers.id}>
<Text style={styles.title}> {numbers.number} </Text>
<Text style={styles.description}>
{' '}
{numbers.description}{' '}
</Text>
</View>
);
})}
</ScrollView>
</View>
);

return (
<Modal
<ModalComponent
visible={visible}
transparent
onRequestClose={() => setVisible(false)}
animationType="fade">
<View style={styles.modalContainer}>
<Container>
<TouchableOpacity
onPress={() => {
setVisible(false);
}}
style={styles.icon}>
<Icon
name="times-circle"
type="font-awesome"
color={colors.primary}
size={35}
/>
</TouchableOpacity>
{renderEmergencyNumbersList()}
</Container>
</View>
</Modal>
setVisible={setVisible}
list={emergencyNumbers}
/>
);
}
46 changes: 0 additions & 46 deletions app/src/components/FAQModals/EmergencyNumbersModal/styles.js

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit e703da1

Please sign in to comment.