cianru / huawei-appgallery-publish-gradle-plugin

Huawei AppGallery Publish Gradle Plugin allows you to publish the android release build file (*.apk or *.aab) to the Huawei AppGallery store
Apache License 2.0
111 stars 20 forks source link

Replace 'publish' with 'deployType' parameter #12

Closed zhelanov closed 3 years ago

zhelanov commented 3 years ago

Hi guys! I've faced a problem without an option to only upload files:

After apk uploading plugin calls updateAppFileInformation() method. If we upload apk without (!) publishing to all users then there will be two releases of app in Huawei Connect:

  1. Available for all users
  2. Draft of release

It's okay and we create a release from a draft with availability for some percent of users. Right after this we've found a bug and we need to upload another version of apk. Then (again, without publishing) we call

gradle publishHuaweiAppGallery --no-publish

and it throws an exception

> Update App File Info is failed. Response: UpdateAppFileInfoResponse(ret=Ret(code=204144647, msg=[cds]update service failed, additional msg is [phased release is on shelf, cannot save or update full release service version!]))

So it might be cool to be able in this case to just upload files automated from CI and do other stuff in AppGallery Connect manually

destanyinside commented 3 years ago

HuaweiAppGallery allows to create only 2 drafts. And this is a very stupid limitation...

cosic commented 3 years ago

Thank you for your a new issue discovery. Huawei brings me pain.

Well, let me think a little bit. Seems a new boolean parameter is overhead. It would be better to create a single enum param with "publish", "draft" and "upload-only" options.

zhelanov commented 3 years ago

@cosic , changed deploy type to enum. Please review my changes :) Thanks!

cosic commented 3 years ago

@zhelanov Please change target branch from master to develop. Unfortunately I've did a lot code changes. If you would like I can add your changes for next release on my own.

zhelanov commented 3 years ago

I can add your changes for next release on my own.

Okay! if it won't give you much trouble then I'll appreciate it :)

cosic commented 3 years ago

@zhelanov Please could you try 1.2.1-SNAPSHOT plugin version from snapshot-1.2.1 branch and check that changes are working?

zhelanov commented 3 years ago

Okay, I'll check it. Thanks!

zhelanov commented 3 years ago

@cosic, for some reason I can't build plugin on snapshot-1.2.1, it compiles an empty jar:

$ du -hs build/libs/huawei-publish-gradle-plugin.jar
4.0K    build/libs/huawei-publish-gradle-plugin.jar
zhelanov commented 3 years ago

I've got it from https://oss.sonatype.org/content/repositories/snapshots/ru/cian/huawei-publish-gradle-plugin/ . I've tested deployType = DeployType.UPLOAD_ONLY and it seems to not work as expected: it updates App File Info still

One thing to note: expected 'client_key' key in credentials json was changed to 'client_secret' so it'll be necessary to change json in projects that use this plugin

cosic commented 3 years ago

@zhelanov

I've got it from https://oss.sonatype.org/content/repositories/snapshots/ru/cian/huawei-publish-gradle-plugin/ . I've tested deployType = DeployType.UPLOAD_ONLY and it seems to not work as expected: it updates App File Info still

You are right. It's my mistake. Please check snapshot again.

One thing to note: expected 'client_key' key in credentials json was changed to 'client_secret' so it'll be necessary to change json in projects that use this plugin

Yeap! You can read about these changes in the CHANGELOG.md at snapshot-1.2.1 branch.

zhelanov commented 3 years ago

Yep, now UPLOAD_ONLY and DRAFT works as expected 👍

cosic commented 3 years ago

Released at v1.2.1