With GitLab and fastlane we’re getting, with minimal effort: Source control, project home, issue tracking, and everything else that comes with GitLab. Content and images metadata for Google Play Store listing managed in source control. Automatic signing, version numbers, and changelog.
How to publish Android apps to the Google Play Store with GitLab and fastlane
With GitLab and fastlane we’re getting, with minimal effort: Source control, project home, issue tracking, and everything else that comes with GitLab. Content and images metadata for Google Play Store listing managed in source control. Automatic signing, version numbers, and changelog. Automatic publishing to internal distribution channel in Google Play Store. Manual promotion through alpha, beta, and production channels.
Containerized build environment, available in GitLab’s container registry. If you’d like to jump ahead and see the finished product, you can take a look at the already-completed Gitter for Android. Configuring fastlane We’ll begin first by setting up fastlane in our project, make a couple key changes to our Gradle configuration, and then wrap everything up in a GitLab pipeline.
Initializing your project First up, you need to get fastlane installed locally and initialize your product.
We’re using the Ruby fastlane gem so you’ll need Ruby on your system for this to work. You can read about other install options in the fastlane documentation. From this point you can run fastlane by typing bundle exec fastlane. Now that we have fastlane ready to run, we just need to initialize our repo with our configuration.
Run bundle exec fastlane init from within your project directory, answer a few questions, and fastlane will create a new. Please refer to these detailed instructions for collecting the credentials necessary to run supply.
From this point you’re able to manage all of your store content as-code; when we publish a new version to the store later, the versions of content checked into your source repo will be used to populate the entry.
Appfile The. The first section contains our definitions for how we want to run builds and tests. As you can see, this is pretty straightforward and builds right on top of your already set up Gradle tasks.
In our example, we’ve set up a workflow where a new build can be published to the internal track and then optionally promoted through alpha, beta, and ultimately production. You can read more about available actions here , and it’s even possible to create your own.
Gradle configuration We also made a couple of key changes to our basic Gradle configuration to make publishing easier. Nothing major here, but it does help us make things run a little more smoothly. Secret properties The first changed section gathers the secret variables to be used for signing. These are either loaded via configuration file, or gathered from environment variables in the case of CI.
Because each build’s versionCode that you submit to the Google Play Store needs to be higher than the last, this makes it simple to deal with. Depending on your configuration, you may already be doing this.
We only worry about signing in the release build that would potentially be published to the Google Play Store. When using App Signing by Google Play, you will use two keys: You keep the upload key and use it to sign your app for upload to the Google Play Store. Google will not re-sign any of your existing or new APKs that are signed with the app signing key. This enables you to start testing your app bundle in the internal test, alpha, or beta tracks while you continue to release your existing APK in production without Google Play changing it.
We’re just fetching a few prerequisites, installing the Android SDK, and then grabbing fastlane. Dockerfile FROM openjdk: COPY Gemfile. Stages The first thing we do is define the stages that we’re going to use. We’ll set up our build environment, do our debug and release builds, run our tests, deploy to internal, and then promote through alpha, beta, and production.
You can see that, apart from environment, these map to the lanes we set up in our Fastfile. If you’re not familiar with. The very first thing we do is set up an.
In this case, it will be used by the subsequent updateContainer and ensureContainer jobs. Dockerfile syntax won’t trigger for a subsequent pipeline after you fix things. This can leave your branch without a Docker image to use. So the ensureContainer job will look for an existing image and only build one if it doesn’t exist. The one downside to this is that both of these jobs will run at the same time if it is a new branch. Similar to above, we use a template to set up repeated steps within our build jobs, avoiding duplication.
Within this section, the first thing we do is set the image to the build environment container image we built in the previous step. Next up is a step that’s specific to Gitter, but if you use shared assets between a iOS and Android build you might consider doing something similar.
What we’re doing here is grabbing the latest mobile artifacts built by the web application pipeline and placing them in the appropriate location. This allows us to inject the file into the build at runtime instead of checking it into source control, a potential security concern. I won’t dive into the the details of the MR creation script here since it’s somewhat specific to Gitter, but if you’re interested in how something like this might work check out the create-changlog-mr.
Make the changelog – cp. First, whenever a build job is done, we remove the jks file just to be sure it doesn’t get saved to artifacts, and second we set up the artifact directory from where the output of the build. Both just call the appropriate fastlane task which, if you remember, then calls the appropriate Gradle task. The buildRelease output is associated with the production environment so we can define an extra production-scoped set of project-level variables which are different from our testing variables.
Since we set up code signing in the Gradle config build. Note that we are using a dependency from the buildDebug job to ensure we don’t need to rebuild anything.
We only publish to the internal testing track and promote this same build to the rest of the tracks. This is achieved through the fastlane integration, using a pre-built action to handle the job. In this case we are using a dependency on the buildRelease job, and creating a local copy of the Google API JSON keyfile again stored in a project-level variable instead of checking it into source control. If you prefer to continuously deliver to your internal track you’d simply need to remove the when: If you’re like me, this may seem too easy to work.
With everything we’ve configured in GitLab and fastlane to this point, it’s really this simple! If internal testing is good, it can be promoted one step forward in sequence all the way through to production using these manual jobs.
If you’re with me to this point, there’s really nothing new here and this really highlights the power of GitLab with fastlane. We have a. This is to ensure that the production build uses the separate set of production environment variables which only happens for the buildRelease job. We also have these variables set as protected so we can enforce that they are only used on the master branch which is protected.
Variables The last step is to make sure you set up the project-level variables we used throughout the configuration above:
Google Play Services
Now users can directly download apps in APK format, quick and safe. Plus, you’ll get automatic updates as well as the option to rollback to any previous version. Uptodown is a totally open app marketplace, without any regional locks or country-specific restrictions. Plus, you don’t need to go through any sign up processes or subscriptions here.
VIDEO: Apk Play Store Android
The app is super responsive, as well as the download speed. The ultimate choice for modified / tweaked / hacked / cracked apps and games for your Android. Google Play for Android, free and safe download. The Google Play APK is no longer officially available to download and install, but comes pre-installed with.