Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
upload

GitHub Action

google-play-console

0.4.0

google-play-console

upload

google-play-console

Transparent Google Play Console CLI wrapper for Github Action

Installation

Copy and paste the following snippet into your .yml file.

              

- name: google-play-console

uses: Vacxe/[email protected]

Learn more about this action in Vacxe/google-play-cli

Choose a version

Google play CLI

CLI tool for publish and management application in Google Play Console.

Actually this library is CLI wrapper for Google Play Java library

List of all vailable commands in wiki WIP

How to install

Brew

brew tap vacxe/tap
brew install vacxe/tap/googleplaycli

How to use

  • Before at all you should obtain a serviceAccount.json

    Goto: Google Play Console -> Developer Account -> Api access -> Service Accounts -> CREATE SERVICE ACCOUNT Follow the instruction and grant the access for service accout

  • Try simplest command

    • google-play-cli --help - list of all commands
    • google-play-cli apk list --config-file service_account.json --package-name <your uploaded apk package name>
  • Apk info extraction

    Install Apk info extractor and JQ apkinfoextractor <pathtoApk> | jq '.package'

  • How to upload apk Bash function can be copied to any .sh file and used as uploadapk "path/to/my.apk" "path/to/service_account.json"

function uploadapk(){
  path_to_apk=$1
  export PLAYSTORE_SERVICE_ACCOUNT_JSON_FILE=$2
  
  #If proxy needed
  #PLAYSTORE_PROXY=192.168.0.1:3128
  
  #Increase connection timeout
  #PLAYSTORE_CONNECTION_TIMEOUT=PT6M

  apk_package=$(apkinfoextractor $path_to_apk | jq '.package')
  export APP_PACKAGE_NAME=$apk_package

  apk_version_code=$(apkinfoextractor $path_to_apk | jq '.versionCode')

  edit_id=$(google-play-cli edit create)
  google-play-cli apk upload --edit-id $edit_id --apk $path_to_apk
  google-play-cli tracks update --edit-id $edit_id --track "internal" --apk-version-code $apk_version_code
  google-play-cli edit validate --edit-id $edit_id
  google-play-cli edit commit --edit-id $edit_id

  unset APP_PACKAGE_NAME
  unset PLAYSTORE_SERVICE_ACCOUNT_JSON_FILE
}

On CI you can add service account json file as a secret to environment variable

PLAYSTORE_SERVICE_ACCOUNT_JSON_CONTENT

Run in Docker

ghcr.io/vacxe/google-play-cli:<VERSION>

GitHub Action

Note: replace @master with latest version for stable behaviour or leave it for last updates

Bundle upload example

      - uses: vacxe/google-play-cli-kt@master
        with:
          template: bundles-upload
          service-account-json: ${{ secrets.SERVICE_ACCOUNT_JSON }}
          version-code: ${{ github.run_number }} # You may need to know version code
          changes-not-sent-for-review: true
          package-name: <package name>
          path-to-bundle: <path to bundle>
          track: internal

Custom script example

      - uses: vacxe/google-play-cli-kt@master
        with:
          custom-script: "Any direct calls for google-play-cli"

License
-------

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.