Skip to content

Commit

Permalink
update eas ci workflow (#51)
Browse files Browse the repository at this point in the history
* update eas ci workflow

* Update package.json

* add config
  • Loading branch information
BilligsterUser committed Jun 11, 2023
1 parent 519aff4 commit 0dc9d3a
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 4 deletions.
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"expo:doc": "npx -y expo-doctor@latest",
"build:dev": "npx -y eas-cli@latest build -e development -p android -m devWithDevClient --no-wait",
"build:preview": "npx -y eas-cli@latest build -e preview -p android -m previewNoDevClient --no-wait",
"build:ci": "npx -y eas-cli@latest build --non-interactive -e development -p android -m ciDevBuild --no-wait",
"build:ci": "npx -y eas-cli@latest build --non-interactive -e preview -p android -m ciPreviewBuild --no-wait",
"eas-build-on-success": "npx bugsnag-eas-build-on-success",
"android": "expo start --android",
"ios": "expo start --ios",
Expand Down Expand Up @@ -149,6 +149,5 @@
"bugs": {
"url": "https://github.com/cashubtc/eNuts/issues"
},
"main": "src/AppEntry.ts",
"private": true
}
"main": "src/AppEntry.ts"
}
30 changes: 30 additions & 0 deletions src/config/config.base.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { env } from '@src/consts'

export interface ConfigBaseProps {
persistNavigation: 'always' | 'dev' | 'prod' | 'never'
catchErrors: 'always' | 'dev' | 'prod' | 'never'
exitRoutes: string[]
env: typeof env
}

export type PersistNavigationConfig = ConfigBaseProps['persistNavigation']

const BaseConfig = {
// This feature is particularly useful in development mode, but
// can be used in production as well if you prefer.
persistNavigation: 'dev',

/**
* Only enable if we're catching errors in the right environment
*/
catchErrors: 'always',

/**
* This is a list of all the route names that will exit the app if the back button
* is pressed while in that screen. Only affects Android.
*/
exitRoutes: ['Welcome'],
env
} as const

export default BaseConfig
10 changes: 10 additions & 0 deletions src/config/config.dev.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* These are configuration settings for the dev environment.
*
* Do not include API secrets in this file or anywhere in your JS.
*
* https://reactnative.dev/docs/security#storing-sensitive-info
*/
export default {
API_URL: 'https://api.rss2json.com/v1/',
}
10 changes: 10 additions & 0 deletions src/config/config.prod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* These are configuration settings for the production environment.
*
* Do not include API secrets in this file or anywhere in your JS.
*
* https://reactnative.dev/docs/security#storing-sensitive-info
*/
export default {
API_URL: 'CHANGEME',
}
28 changes: 28 additions & 0 deletions src/config/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* This file imports configuration objects from either the config.dev.js file
* or the config.prod.js file depending on whether we are in __DEV__ or not.
*
* Note that we do not gitignore these files. Unlike on web servers, just because
* these are not checked into your repo doesn't mean that they are secure.
* In fact, you're shipping a JavaScript bundle with every
* config variable in plain text. Anyone who downloads your app can easily
* extract them.
*
* If you doubt this, just bundle your app, and then go look at the bundle and
* search it for one of your config variable values. You'll find it there.
*
* Read more here: https://reactnative.dev/docs/security#storing-sensitive-info
*/
import BaseConfig from './config.base'
import DevConfig from './config.dev'
import ProdConfig from './config.prod'

let ExtraConfig = ProdConfig

if (__DEV__) {
ExtraConfig = DevConfig
}

const Config = { ...BaseConfig, ...ExtraConfig } as const

export default Config

0 comments on commit 0dc9d3a

Please sign in to comment.