.ENV file test

This commit is contained in:
Gergely Hegedus 2023-09-28 16:25:15 +03:00
parent 29d421e4c6
commit df4dbfa09b
6 changed files with 52 additions and 3 deletions

View file

@ -51,6 +51,11 @@ jobs:
echo "$firebase_service_account_base64" | base64 --decode > firebase-distribution-service-account.json echo "$firebase_service_account_base64" | base64 --decode > firebase-distribution-service-account.json
echo "CI_EVAL_FIREBASE_DISTRIBUTION_AUTH_FILE=`pwd`/firebase-distribution-service-account.json" >> $GITHUB_ENV echo "CI_EVAL_FIREBASE_DISTRIBUTION_AUTH_FILE=`pwd`/firebase-distribution-service-account.json" >> $GITHUB_ENV
- name: Staging .ENV File
env:
ENV_FILE_CONTENT: ${{ secrets.CI_STAGING_ENV_FILE_CONTENT }}
run: echo "$ENV_FILE_CONTENT" > .env
- name: Deploy to Firebase - name: Deploy to Firebase
working-directory: ./android working-directory: ./android
run: bundle exec fastlane deployInternalToFirebase release_notes:"${{ github.event.inputs.releaseNotes }}" run: bundle exec fastlane deployInternalToFirebase release_notes:"${{ github.event.inputs.releaseNotes }}"
@ -115,6 +120,11 @@ jobs:
echo "$ios_cert_base64" | base64 --decode > ios_distribution.p12 echo "$ios_cert_base64" | base64 --decode > ios_distribution.p12
echo "CI_EVAL_IOS_CERT_FILE=`pwd`/ios_distribution.p12" >> $GITHUB_ENV echo "CI_EVAL_IOS_CERT_FILE=`pwd`/ios_distribution.p12" >> $GITHUB_ENV
- name: Staging .ENV File
env:
ENV_FILE_CONTENT: ${{ secrets.CI_STAGING_ENV_FILE_CONTENT }}
run: echo "$ENV_FILE_CONTENT" > .env
- name: Deploy to Firebase - name: Deploy to Firebase
env: env:
CI_EVAL_IOS_CERT_PASSWORD: ${{ secrets.CI_EVAL_IOS_CERT_PASSWORD }} CI_EVAL_IOS_CERT_PASSWORD: ${{ secrets.CI_EVAL_IOS_CERT_PASSWORD }}

View file

@ -52,6 +52,12 @@ jobs:
run: | run: |
echo "$play_store_service_account_base64" | base64 --decode > play-store-distribution-service-account.json echo "$play_store_service_account_base64" | base64 --decode > play-store-distribution-service-account.json
echo "CI_EVAL_ANDROID_PLAY_STORE_AUTH_FILE=`pwd`/play-store-distribution-service-account.json" >> $GITHUB_ENV echo "CI_EVAL_ANDROID_PLAY_STORE_AUTH_FILE=`pwd`/play-store-distribution-service-account.json" >> $GITHUB_ENV
- name: Prod .ENV File
env:
ENV_FILE_CONTENT: ${{ secrets.CI_PROD_ENV_FILE_CONTENT }}
run: echo "$ENV_FILE_CONTENT" > .env
- name: Deploy to Play Store Internal Track - name: Deploy to Play Store Internal Track
env: env:
CI_EVAL_ANDROID_KEYSTORE_KEY_ALIAS: ${{ secrets.CI_EVAL_ANDROID_KEYSTORE_KEY_ALIAS }} CI_EVAL_ANDROID_KEYSTORE_KEY_ALIAS: ${{ secrets.CI_EVAL_ANDROID_KEYSTORE_KEY_ALIAS }}
@ -120,6 +126,11 @@ jobs:
echo "$app_store_api_key_base64" | base64 --decode > api_key.p8 echo "$app_store_api_key_base64" | base64 --decode > api_key.p8
echo "CI_EVAL_IOS_APP_STORE_KEY_FILE=`pwd`/api_key.p8" >> $GITHUB_ENV echo "CI_EVAL_IOS_APP_STORE_KEY_FILE=`pwd`/api_key.p8" >> $GITHUB_ENV
- name: Prod .ENV File
env:
ENV_FILE_CONTENT: ${{ secrets.CI_PROD_ENV_FILE_CONTENT }}
run: echo "$ENV_FILE_CONTENT" > .env
- name: Deploy to TestFlight - name: Deploy to TestFlight
env: env:
CI_EVAL_IOS_CERT_PASSWORD: ${{ secrets.CI_EVAL_IOS_CERT_PASSWORD }} CI_EVAL_IOS_CERT_PASSWORD: ${{ secrets.CI_EVAL_IOS_CERT_PASSWORD }}

View file

@ -14,6 +14,7 @@ import {
useColorScheme, useColorScheme,
} from 'react-native'; } from 'react-native';
import {Colors} from './src/colors'; import {Colors} from './src/colors';
import {MY_ENV_VAR} from '@env';
function App(): JSX.Element { function App(): JSX.Element {
const isDarkMode = useColorScheme() === 'dark'; const isDarkMode = useColorScheme() === 'dark';
@ -32,7 +33,7 @@ function App(): JSX.Element {
backgroundColor={backgroundStyle.backgroundColor} backgroundColor={backgroundStyle.backgroundColor}
/> />
<ScrollView contentInsetAdjustmentBehavior="automatic"> <ScrollView contentInsetAdjustmentBehavior="automatic">
<Text style={textStyle}>{'hello world'}</Text> <Text style={textStyle}>{`hello world ${MY_ENV_VAR}`}</Text>
</ScrollView> </ScrollView>
</SafeAreaView> </SafeAreaView>
); );

View file

@ -1,3 +1,4 @@
module.exports = { module.exports = {
presets: ['module:metro-react-native-babel-preset'], presets: ['module:metro-react-native-babel-preset'],
plugins: ['module:react-native-dotenv'],
}; };

25
package-lock.json generated
View file

@ -25,6 +25,7 @@
"jest": "^29.2.1", "jest": "^29.2.1",
"metro-react-native-babel-preset": "0.76.8", "metro-react-native-babel-preset": "0.76.8",
"prettier": "^2.4.1", "prettier": "^2.4.1",
"react-native-dotenv": "^3.4.9",
"react-test-renderer": "18.2.0", "react-test-renderer": "18.2.0",
"typescript": "4.8.4" "typescript": "4.8.4"
}, },
@ -5735,6 +5736,18 @@
"node": ">=6.0.0" "node": ">=6.0.0"
} }
}, },
"node_modules/dotenv": {
"version": "16.3.1",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz",
"integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==",
"dev": true,
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/motdotla/dotenv?sponsor=1"
}
},
"node_modules/ee-first": { "node_modules/ee-first": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
@ -10657,6 +10670,18 @@
"react": "18.2.0" "react": "18.2.0"
} }
}, },
"node_modules/react-native-dotenv": {
"version": "3.4.9",
"resolved": "https://registry.npmjs.org/react-native-dotenv/-/react-native-dotenv-3.4.9.tgz",
"integrity": "sha512-dbyd+mcy7SUzxEgmt33TRf1FGcNe6swJhXmB0unKkI49F7+pidog9kPtjxMLTAfmKA8gcN2XHQSKltGfGbGCLQ==",
"dev": true,
"dependencies": {
"dotenv": "^16.3.1"
},
"peerDependencies": {
"@babel/runtime": "^7.20.6"
}
},
"node_modules/react-native/node_modules/@jest/types": { "node_modules/react-native/node_modules/@jest/types": {
"version": "26.6.2", "version": "26.6.2",
"resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz",

View file

@ -28,7 +28,8 @@
"metro-react-native-babel-preset": "0.76.8", "metro-react-native-babel-preset": "0.76.8",
"prettier": "^2.4.1", "prettier": "^2.4.1",
"react-test-renderer": "18.2.0", "react-test-renderer": "18.2.0",
"typescript": "4.8.4" "typescript": "4.8.4",
"react-native-dotenv": "^3.4.9"
}, },
"engines": { "engines": {
"node": ">=16" "node": ">=16"