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

Draft: Android CI production build and Play Store auto-submission #2909

Closed
wants to merge 16 commits into from

Conversation

danryu
Copy link
Contributor

@danryu danryu commented Oct 12, 2022

Description

This PR implements a best-practices CI build for submission of the client to Google Play Store, following the advice at
https://doc.qt.io/qt-6/android-publishing-to-googleplay.html

This includes additional small changes for recording permission with Qt6 on Android, and does not support Qt5.

Note: I have found from experience that it is better to use the Github-image-provided Android SDK/NDK tools, rather than create custom logic to do custom installations of those. See the notes in android.sh.

This build creates 4 x separate .aab files (one for each available Android ABI) and submits them as part of the same package to the Play Store, where the developer can then add it to a Testing track as they please.
Note that this PR doesn't push the build straight to Live/Production status. The default is to go to an Open Testing track for beta testers only, and is in draft status until you promote it in the Play Store GUI.

CHANGELOG: Build Android release for Play Store and auto-submit

Documentation

Requires additional GITHUB SECRETS:

${{ secrets.GOOGLE_SERVICE_ACCOUNT_JSON }}

  • Google Play - Service Account JSON setup:
    • Google Play Console -> Setup -> API Access -> Create/Link Google Cloud Project
    • Google Cloud console -> IAM & Admin -> Service Accounts -> Create (Wizard). Then create JSON key and export/save

${{ secrets.GOOGLE_KEYSTORE }}
${{ secrets.GOOGLE_KEYSTORE_PASS }}

Status of this Pull Request

What is missing until this pull request can be merged?

Checklist

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

@pljones
Copy link
Collaborator

pljones commented Oct 12, 2022

Hi @danryu,

Thanks for your PR. Could you review the check failures and fix them, please.

-- Peter

@danryu
Copy link
Contributor Author

danryu commented Oct 13, 2022

Pushed all the fixes that I could see needed handling.
This build is now set for Qt 6.3.2 and will fail with Qt5.
I've also updated the recording permission handling to work with Qt6.
From personal experience I highly recommend 6.3.2+ for Android.

Copy link
Member

@ann0see ann0see left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much

Jamulus.pro Outdated
ANDROID_VERSION_CODE = $$system(git log --oneline | wc -l)

# date-based unique value - prevent clashes in Play Store build numbering
!defined(ANDROID_VERSION_CODE, var):ANDROID_VERSION_CODE = $$system(date +%s | cut -c 2-)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work on windows I suppose? Wouldn't the git commit hash or something else be better?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI is obviously targeted purely for Linux.
For local building on Windows we can just hardcode any int value.
ANDROID_VERSION_CODE = 123456

Android Version Code requires an integer <=2100000000.
So you'd need some custom logic to convert the shorthash to int first.

I don't like relying on git log because you need a separate version code for armeabi7 and armv8 builds.
The above date output guarantees a unique, valid value for each Play Store submission.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI is obviously targeted purely for Linux.

But as it's in Jamulus.pro we should ensure cross compatibility. Even if it's a noop.

Jamulus.pro Outdated Show resolved Hide resolved
@danryu
Copy link
Contributor Author

danryu commented Oct 17, 2022

If the additional Github Secrets are added according to the updated Documentation section in this PR, the Auto-Build should complete successfully.

There are some Coding Style failures and I'm not sure how valid or useful the remaining shfmt errors are - unfortunately I don't have more time to devote to this PR.

If desired, you can merge the changes to a future feature branch and I can close this PR.

@ann0see
Copy link
Member

ann0see commented Oct 28, 2022

Ok. Squashed and merged to a feature branch: https://github.com/jamulussoftware/jamulus/tree/feature/koord/CIPlaystore. Hopefully, in future work can be continued.

Closing.

@hoffie
Copy link
Member

hoffie commented Oct 30, 2022

@danryu Thanks a lot of upstreaming this! I think this PR contains some very valuable contributions to update the build environment and enable Qt6 compatibility (#2528). Not sure if we should integrate the playstore-related parts right now, might still be a bit early with little to no testing happening in this area.

Sorry for not chiming in earlier (time is limited...). I certainly plan to integrate large parts of this and will submit new PR(s) with the relevant parts (with proper attribution of @danryu, of course).

@danryu
Copy link
Contributor Author

danryu commented Oct 31, 2022

@hoffie Happy to contribute!

PS if you want to get a sense of the end result of this PR, a reasonable indicator is to try Koord, as installed from the Play Store.
While the Koord app client build differs visually/presentation-wise to Jamulus, the core business logic is basically untouched.
By the way, once the transition to QML is done, mobile UI stuff will of course get a lot easier.

Edit: Note that this PR doesn't push the build straight to Live/Production status. The default is to go to an Open Testing track for beta testers only, and is in draft status until you promote it in the Play Store GUI.
So there's no danger of putting an unwanted build out to the public. You can test in Open/Closed Testing tracks for as long as you like before going "live".

@pljones
Copy link
Collaborator

pljones commented May 23, 2023

For clarity, we're looking at splitting this into:

  • Qt6 for Android
  • Google Play Store for Android

Currently "in progress" is #2528.

@ann0see
Copy link
Member

ann0see commented May 23, 2023

I think a lot of work is already done on the feature branch. I'd personally focus on iOS as I don't own an up to date Android device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants