diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index 49f79cd9..0d0681b1 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -16,6 +16,7 @@ env: SIS_SENTRY_ORG: ${{ secrets.SIS_PRODUCTION_SENTRY_ORG }} SIS_SENTRY_PROJECT: ${{ secrets.SIS_PRODUCTION_SENTRY_PROJECT }} SIS_SENTRY_AUTH_TOKEN: ${{ secrets.SIS_PRODUCTION_SENTRY_AUTH_TOKEN }} + SIS_GOOGLE_SERVICES_JSON: ${{ secrets.SIS_PRODUCTION_GOOGLE_SERVICES_JSON }} SIS_ANDROID_GOOGLE_MAPS_KEY: ${{ secrets.SIS_PRODUCTION_ANDROID_GOOGLE_MAPS_KEY }} SIS_IOS_GOOGLE_MAPS_KEY: ${{ secrets.SIS_PRODUCTION_IOS_GOOGLE_MAPS_KEY }} @@ -56,5 +57,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/v') run: echo ::set-env name=RELEASE_CHANNEL::${GITHUB_REF:10} # Remove refs/tags/ - name: Generate production app.json - run: ./scripts/generateAppJson.js > app.json + run: | + ./scripts/generateAppJson.js > app.json + ./scripts/generateGoogleServicesJson.js > google-services.json - run: expo ${{ matrix.expo_build_command }} --release-channel=production-${{ env.RELEASE_CHANNEL }} diff --git a/.gitignore b/.gitignore index 8c51f89d..2d534075 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ yarn-error.log* app.json app.staging.json app.production.json +google-services.json # ide files .idea/ diff --git a/App/Screens/Search/fetchAlgolia.ts b/App/Screens/Search/fetchAlgolia.ts index 603c5465..c9bdc331 100644 --- a/App/Screens/Search/fetchAlgolia.ts +++ b/App/Screens/Search/fetchAlgolia.ts @@ -91,7 +91,7 @@ export function fetchAlgolia( query: search, }, { - timeout: 5000, + timeout: 10000, } ), 'fetchAlgolia' diff --git a/scripts/generateAppJson.js b/scripts/generateAppJson.js index cb8bb442..602ad778 100755 --- a/scripts/generateAppJson.js +++ b/scripts/generateAppJson.js @@ -53,4 +53,15 @@ const overrides = { }, }; -console.log(JSON.stringify(merge(defaultAppJson, overrides))); +// Add link to `google-services.json`, if ENV variable is set. +const googleServices = process.env.SIS_GOOGLE_SERVICES_JSON + ? { + expo: { + android: { + googleServicesFile: './google-services.json', + }, + }, + } + : {}; + +console.log(JSON.stringify(merge(defaultAppJson, overrides, googleServices))); diff --git a/scripts/generateGoogleServicesJson.js b/scripts/generateGoogleServicesJson.js new file mode 100755 index 00000000..2ae5d906 --- /dev/null +++ b/scripts/generateGoogleServicesJson.js @@ -0,0 +1,9 @@ +#!/usr/bin/env node + +/** + * This script will take the `SIS_GOOGLE_SERVICES_JSON` string, parse it, and + * output the parsed object. It is used to create the `google-services.json` + * file in production. + */ + +console.log(JSON.parse(process.env.SIS_GOOGLE_SERVICES_JSON));