Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use our own FCM credentials #568

Merged
merged 3 commits into from
Apr 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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));