diff --git a/.gitignore b/.gitignore index 52b72433a..00531b87f 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,5 @@ web-build/ # macOS .DS_Store* .env* -environment.js \ No newline at end of file +environment.js +scripts/dynamic-env/app.secrets.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 8674f3b2e..cda9e3fc0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,6 @@ All notable changes to this project will be documented in this file. See [standa ## [10.3.0](https://github.com/hopetambala/puente-reactnative-collect/compare/v10.1.4...v10.3.0) (2021-01-09) -## [10.2.0](https://github.com/hopetambala/puente-reactnative-collect/compare/v10.1.4...v10.2.0) (2021-01-09) - -### [10.1.4](https://github.com/hopetambala/puente-reactnative-collect/compare/v10.1.3...v10.1.4) (2021-01-09) - -## [10.1.0](https://github.com/hopetambala/puente-reactnative-collect/compare/v10.0.0...v10.1.0) (2021-01-09) - ### New Features diff --git a/package.json b/package.json index af04d6e21..ebadc2a51 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,10 @@ "testDebug": "jest -o --watch --coverage=false", "lint": "./node_modules/.bin/eslint '**/*.{js,jsx}' --quiet", "lint-fix": "./node_modules/.bin/eslint '**/*.{js,jsx}' --fix", - "publish-staging": "expo build:ios --release-channel staging && expo build:android --release-channel staging", - "publish-prod": "expo build:ios --release-channel prod && expo build:android --release-channel prod", - "upload": "expo upload:ios --latest && expo upload:android --latest", + "prepublish": "node scripts/dynamic-env/generate-env-app-json.js > app.generated.json", + "publish-staging": "npm run prepublish && expo build:ios --config app.generated.json --release-channel staging && expo build:android --config app.generated.json --release-channel staging", + "publish-prod": "npm run prepublish && expo build:ios --config app.generated.json --release-channel prod && expo build:android --config app.generated.json --release-channel prod", + "upload": "expo upload:ios --config app.generated.json --latest && expo upload:android --config app.generated.json --latest && rm -rf app.generated.json", "gh-prune": "git fetch -p && for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done", "release-patch": "npx standard-version --release-as patch", "release-minor": "npx standard-version --release-as minor", @@ -93,4 +94,4 @@ "standard-version-expo": "1.0.3" }, "private": true -} +} \ No newline at end of file diff --git a/scripts/dynamic-env/app.secrets-example.json b/scripts/dynamic-env/app.secrets-example.json new file mode 100644 index 000000000..990f529af --- /dev/null +++ b/scripts/dynamic-env/app.secrets-example.json @@ -0,0 +1,15 @@ +{ + "expo": { + "ios": { + "bundleIdentifier": "SECRET_BUNDLE_IDENTIFIER" + }, + "android": { + "package": "PACKAGE_NAME", + "config": { + "googleMaps": { + "apiKey": "YOUR_GOOGLE_API_KEY" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/dynamic-env/generate-env-app-json.js b/scripts/dynamic-env/generate-env-app-json.js new file mode 100644 index 000000000..bd3ffd771 --- /dev/null +++ b/scripts/dynamic-env/generate-env-app-json.js @@ -0,0 +1,5 @@ +const merge = require("deepmerge") +const baseAppJson = require("../../app.json") +const override = require("./app.secrets.json") +const merged = merge.all([baseAppJson, override]) +console.log(JSON.stringify(merged, null, 2)) \ No newline at end of file