Jenkins Google Play Publish

1. Install the google play Jenkins plugin

  https://wiki.jenkins-ci.org/display/JENKINS/Google+Play+Android+Publisher+Plugin

2. Configure service account

    1) Login https://play.google.com/apps/publish with your google play billing accout and navigate to 'Setting'->'API access'

    2) Follow the link to the ‘Google Developer console’

    3) Click ‘Manage Service Accounts’ in the Credential page (tiny link in the right-middle side of the page...)

    4) Create a key for the service account and download with Json format

3. Add service account to Jenkins

    1) Select ‘Credential’ -> ’System’ -> ‘Global Credentials’ in Jenkins sidebar

    2) Add Credentials, select ‘Google Service Account from private key’, specify the project name(e.g. ‘GoogleServiceAccount’) and upload Json key downloaded in step 2.4

4. For android project

    1)  Increment the VersionCode in build.gradle 

    2)  Add the release setting in build.gradle

    signingConfigs {
        release {
            storeFile file("keystore.jks")
            storePassword "xxxx"
            keyAlias "xxxx"
            keyPassword "xxxx"
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
    }
Release Setting in build.gradle

  3)  Explicitly set android:debuggable="false" in AndroidManifest.xml application tag 

5. For jenkins (pipeline) job configuration: https://wiki.jenkins-ci.org/display/JENKINS/Google+Play+Android+Publisher+Plugin

   1) Build release apk:     

    sh './gradlew assembleRelease'

 2) Publish release apk to google play alpha track

    androidApkUpload googleCredentialsId: 'GoogleServiceAccount', apkFilesPattern: '**/app-release.apk', trackName: 'alpha'

 

posted @ 2017-03-29 14:19  Majesty  阅读(625)  评论(0编辑  收藏  举报