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
[supply][action] add download_apk_from_google_play
action (and corresponding supply
methods)
#21315
[supply][action] add download_apk_from_google_play
action (and corresponding supply
methods)
#21315
Conversation
9c0555b
to
01d9661
Compare
Add methods on the Supply client to list and download Universal Generated APKs from the Google Play Console — typically generated and code-signed by Google from the AAB you uploaded e.g. via the `upload_to_play_store`/`supply` action
Very useful when you use [Play App Signing](https://support.google.com/googleplay/android-developer/answer/9842756) and thus don't necessary have the signing key to produce the APK yourself. In those cases, you typically only upload an AAB to GPC, then let Google code-sign and generate signed APKs from that AAB.
…` exceptions Because most of the options that are detected as not being used directly by the action are in fact just passed along to Supply::Client.make_from_config
01d9661
to
546df7e
Compare
download_apk_from_google_play
action (and corresponding Supply methods)download_apk_from_google_play
action (and corresponding supply
methods)
@joshdholtz Now that you're back from your vacation 😃 May I kindly ask a review of this one? I'd love to be able to finally use it in our automation soon 🙂 |
expect(subject.class.method_defined?(:list_generatedapks)).to eq(true) | ||
expect(subject.class.method_defined?(:download_generatedapk)).to eq(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. That spec tests methods we expect to be defined on the AndroidPublisher::AndroidPublisherService
internal client (not to be confused with the Supply::Client
).
Those two particular ones that I added there are documented here in the AndroidPublisherService
ruby doc:
AndroidPublisher::AndroidPublisherService#list_generatedapks
AndroidPublisher::AndroidPublisherService#download_generatedapk
And those are the ones that I call in the Supply::Client
corresponding wrapper methods here and here, respectively.
So all that is correct, and consistent with how the rest of the spec and that file is written 🙂
(Plus, that spec/test passes on CI, while it would be red if those were not correct)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see. Thanks! I'm much less familiar with the Android code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries! Took me some time to familiarize myself with the AndroidPublisher API and Supply code and specs as well when I wrote that PR 😅 🙂
Checklist
bundle exec rspec
from the root directory to see all new and existing tests passbundle exec rubocop -a
to ensure the code style is validci/circleci
builds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)I've updated the documentation if necessary.N/A; actions documentation are auto-generated anywayMotivation and Context
This adds a new
download_apk_from_google_play
action to download the Universal Code-Signed APK generated by Google after you uploaded the AAB.This is especially useful when you use Play App Signing to sign your app, because in those cases you'll typically use the
upload_to_google_play
action to upload a.aab
to Google Play Console (GPC), and let Google generate and code-sign the.apk
files for that.aab
(including split APKs for various architectures, but more importantly the Universal one compatible with all devices)In those situations of using "Play App Signing", you can't use
bundletool
to generate the signed.apk
from the.aab
yourself because you don't have the code signing key (only Google has it), so the only option is to download the.apk
from GPC.And it's useful to get the universal, codesigned APK back because we can use it for running UI tests on it, making sure we run those on the exact APK that will be ultimately shipped to end users (including testing things that rely on code-signing signature checks for security and integrity validation).
Description
Supply::Client
list_generated_universal_apks(package_name:, version_code:)
method onSupply::Client
to be able to call thegeneratedapks.list
API endpointdownload_generated_universal_apk(generated_universal_apk:, destination:)
method onSupply::Client
to be able to call thegeneratedapks.download
API endpointspec/client_spec.rb
testsGeneratedUniversalApk
model to allow manipulating the result of those methods more easilydownload_universal_apk_from_google_play
action as well as its unit tests (spec)Testing Steps
Run the new Unit Tests: