expo-github-action icon indicating copy to clipboard operation
expo-github-action copied to clipboard

How to automate expo upload:android

Open dmiranda2791 opened this issue 4 years ago • 4 comments

Hello! It's me again 😄

Topic and scope of discussion

How would you pass service account JSON to expo upload:android?

Motivation

I want to create a manually triggered Github action to automate uploads to Play Store?

Additional context

expo upload:android requires the --path to the JSON file containing the service account. I dug into the expo-cli code and they use fs.readFile to get the content so not sure how to make it available inside the Github actions. Do you know a way to provide it?

dmiranda2791 avatar Oct 23 '20 04:10 dmiranda2791

Hi @dmiranda2791! Having "secret files" instead of "secret env vars" is a bit harder, but not impossible 😄 You are lucky that the Google Service file is a JSON file, meaning you can easily serialize and deserialize to and from a string. I would recommend putting the contents of your Google Service file into a secret envvar, and use this to convert it to a file.

After that, you can simply point to your newly created file and continue the process. Let me know if that works for you!

byCedric avatar Oct 26 '20 13:10 byCedric

Thanks! I'll give it a try 😁

I'll told you how it goes

dmiranda2791 avatar Oct 30 '20 01:10 dmiranda2791

Thank you @byCedric! It worked perfectly, I have automated uploads Play Store now 😁

dmiranda2791 avatar Nov 20 '20 22:11 dmiranda2791

Awesome, I'll keep this issue open to add it as an example!

byCedric avatar Nov 27 '20 16:11 byCedric