Triple-T / gradle-play-publisher

GPP is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.
MIT License
4.1k stars 340 forks source link

Dry run mode #894

Closed emartynov closed 3 years ago

emartynov commented 3 years ago

Problem description

This is always a pain with the setup to market upload:

  1. You are afraid to break existing beauty
  2. The store is limiting upload by app version - so tedious to increment version all the time
  3. Usually it is done on CI and involving the secrets, so the number of possible mistakes and inconveniences is quadrupling

Potential solutions/workarounds

  1. I don't know if Google has this possibility in API but would be great to have something like a dry run
  2. Even if Google doesn't have it, the plugin can try not to upload apk and interpret the following error as a success, or so
SUPERCILEX commented 3 years ago

Well there's the Gradle dry run option that doesn't run any tasks, but I'm guessing that's not what you want.

GPP has the no commit option which will upload everything and then not publish it which I think is what you want. The one issue is that there are things which don't adhere to the edits api so the no commit option can't be used there (like in app products and internal app sharing for example).

Also of note is that validation tends to happen when you commit IIRC, so a dry run might not catch the errors you care about. Also, the only way you'll be able to check the changes is by calling the api yourself and looking at that pending edit (the play store won't show pending changes from the api).

Docs: https://github.com/Triple-T/gradle-play-publisher#combining-artifacts-into-a-single-release. You probably just want to use --no-commit though since that explanation still publishes things.

API reference: https://developers.google.com/android-publisher/api-ref/rest. Anything under edits can skip the commit.

emartynov commented 3 years ago

Interesting! I did your plugin integration twice already and common issues were:

  1. The key is not correctly propagated from CI secrets/variables
  2. The credentials for a user that don't have correct rights
  3. Content of apk is invalid or something else wrong with the upload

So --no-commit will help at least with the first two.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

SUPERCILEX commented 3 years ago

I just realized there's a validate method which should solve #3: https://developers.google.com/android-publisher/api-ref/rest/v3/edits/validate.