Issue
In order to improve our QA workflow, we want to automatically build an APK file for each pull-request on Github so we can test it BEFORE the branch is merged. We already figured out how to build the file, but we are now wondering how to integrate this in our workflow.
It seems like most available Beta programs (e.g. Crashlytics Beta, Google Play) mostly focus on creating one beta version shortly before the release, but don't allow hosting multiple APKs in parallel.
Here's an example for our ideal workflow:
- Developer finishes coding and creates a pull-request
- Tests run
- If tests are successful, an APK is built automatically and uploaded somewhere (that's the part we're trying to figure out)
- QA takes a look at the pull-request and should be able to easily download the correct APK on their testing device
- If there are no issues during QA, the pull-request is merged
- The APK file is automatically deleted
We specifically don't want to test the APK after the pull-request has been merged, but instead test before so less bugs pop up in our develop branch.
Solution
Actually Crashlytics allow to have several versions of APK. Ech version can have each own Version string and of course release notes, to help QA to find correct APK.
Point 3 from question can be described in that way: CI configured to upload build to Crashlytics. It can be achieved by gradle task:
gradle assembleRelease crashlyticsUploadDistributionRelease
It is really useful to have special build type (pullrequest
) for this case. You can specify special distribution rules via distribution groups, notifications about builds and release notes.
build.gradle:
//example function for change log
def getLastGitCommitMessage() {
try {
"git log -1 --pretty=%B".execute().text.trim()
} catch (e) {
'Undefined message.'
}
}
android {
buildTypes {
...
pullrequest {
//invitation
ext.betaDistributionGroupAliases = "QA, devs"
// notification
ext.betaDistributionNotifications = true
// last commit message as release notes
ext.betaDistributionReleaseNotes = getLastGitCommitMessage()
}
}
}
In this case build and upload command will be like that:
gradle assemblePullrequest crashlyticsUploadDistributionPullrequest
Answered By - solikhver Answer Checked By - David Marino (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.