Skip to content

Commit

Permalink
fix: Use our own FCM credentials (#568)
Browse files Browse the repository at this point in the history
* fix: Use our own FCM credentials

* Only add googleServicesFile if necessary

* timeout 10s
  • Loading branch information
amaury1093 committed Apr 28, 2020
1 parent 069977c commit f8a6d3b
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down Expand Up @@ -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 }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ yarn-error.log*
app.json
app.staging.json
app.production.json
google-services.json

# ide files
.idea/
2 changes: 1 addition & 1 deletion App/Screens/Search/fetchAlgolia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function fetchAlgolia(
query: search,
},
{
timeout: 5000,
timeout: 10000,
}
),
'fetchAlgolia'
Expand Down
13 changes: 12 additions & 1 deletion scripts/generateAppJson.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
9 changes: 9 additions & 0 deletions scripts/generateGoogleServicesJson.js
Original file line number Diff line number Diff line change
@@ -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));

0 comments on commit f8a6d3b

Please sign in to comment.