The plugin allows you to publish the android release build file (*.apk or *.aab) to the Google Play and HUAWEI AppGallery.
The following features are available:
- Upload APK or AAB build file in HUAWEI AppGallery
- Publish APK or AAB build file in Google Play on any track(alpha, release...)
The following features are missing:
- Waits for feedback..
The plugin tested Java 11 - AGP 4.2.2 - Gradle 8.2.1.
in application module ./build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "io.github.makhosh:storepublisher:1.0.6"
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.github.makhosh.storepublisher'
Groovy
storePublisher{
artifactFile = file('')
googlePlay{
applicationId = ''
track = ''
credential = file('')
}
huaweiAppGallery{
appId = ''
clientId = ''
clientSecret = ''
}
}
How to get credentials for HUAWEI AppGallery, please see AppGallery Connect API Getting Started.
How to get credentials for Google Play, please see How to create a Service Account for the Google Play Store.
Parameter | P | Default Value | Description |
---|---|---|---|
apkFile | Mandatory | null | File path of artifact |
applicationId | Mandatory | null | Defined your application default config. Example: com.facebook.katana |
track | Optional | "alpha" | Target stage for Google Play, i.e. internal /alpha /beta /production |
credential | Mandatory | null | Google Play service account credential. Add JSON file path. |
appId | Mandatory | null | HUAWEI AppGallery Application ID. Example: Tiktok App ID: 100315379 |
clientId | Mandatory | null | HUAWEI AppGallery Connect API Client Id |
clientSecret | Mandatory | null | HUAWEI AppGallery Connect API Cliend Secret |
Note for Google Play: If you commit unencrypted Service Account keys to source, you run the risk of letting anyone access your Google Play account. To circumvent this issue, put the contents of your JSON file in the
ANDROID_PUBLISHER_CREDENTIALS
environment variable and don't specify thecredential
property.
Note for HUAWEI AppGallery: If you commit unencrypted client secret to source, you run the risk of letting anyone access your Huawei App Gallery account. To circumvent this issue, put client secret value in the
HUAWEI_PUBLISHER_CREDENTIALS
environment variable and don't specify theclientSecret
property.
Gradle generate storePublisher
task. You can upload a pre-existing artifact.
./gradlew storePublisher
If you want to upload after build, you can finalize your build task with storePublisher
Example:
project.afterEvaluate {
tasks.findByName("assembleRelease").finalizedBy(tasks.findByName("storePublisher"))
}
Free use of this plugin is permitted under the guidelines and in accordance with the Apache License 2.0