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: handle google services files in expo env #7

Closed
5 tasks
zaniluca opened this issue Apr 9, 2022 · 0 comments
Closed
5 tasks

Fix: handle google services files in expo env #7

zaniluca opened this issue Apr 9, 2022 · 0 comments
Assignees
Labels
multiplatform Issue affects both android and ios tech debt Something that we're bringing back from the past that must be addressed and solved

Comments

@zaniluca
Copy link
Owner

zaniluca commented Apr 9, 2022

Summary

TLDR we need to keep google services files private; how do we achieve this? by adding them to .gitignore! The problem is that by doing this EAS doesn't pick them up when uploading to it.

The solution we have rn is to override the .gitignore with a .easignore which has everything ignored by the .gitignore except for the google services files.

This is not considered the best way to handle this situation as mentioned in the related issue; we should follow the solution in the related issue and handle everything with Environment variables in the EAS dashboard, this will benefit in both not having to keep a local copy of the services files and also not having to copy every change to the .gitignore to the .easignore.

When previously trying to use this solution it wasn't working as intended and the build services couldn't decode and copy the files from env.

Todo / ordered steps

  • Download and encode in Base64 the services files ($ base64 google-services.json)
  • Copy the output and paste it into a secret in the EAS console named GOOGLE_SERVICES_ANDROID_BASE64
  • Repeat the steps above for the ios one and change the name to GOOGLE_SERVICES_IOS_BASE64
  • Delete .easignore
  • Add a pre-install hook like this
"eas-build-pre-install": "echo $GOOGLE_SERVICES_ANDROID_BASE64 | base64 --decode > ./google-services.json && echo $GOOGLE_SERVICES_IOS_BASE64 | base64 --decode > ./GoogleService-Info.plist"

Everything should build without failing in the last steps; if it fails will probably be with a message "Can not find google-services.json / GoogleServices_Info.plist"

Possible impacts / side effects on existing features

This will only impact the build phase and should not have any side effect

Additional notes

EAS related issue: expo/eas-cli#228

@zaniluca zaniluca added tech debt Something that we're bringing back from the past that must be addressed and solved multiplatform Issue affects both android and ios labels Apr 9, 2022
@zaniluca zaniluca added the blocked Issue is blocked by another issue or by major barriers label Apr 17, 2022
@zaniluca zaniluca self-assigned this Apr 25, 2022
@zaniluca zaniluca removed the blocked Issue is blocked by another issue or by major barriers label May 2, 2022
@zaniluca zaniluca closed this as completed May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
multiplatform Issue affects both android and ios tech debt Something that we're bringing back from the past that must be addressed and solved
Projects
None yet
Development

No branches or pull requests

1 participant