Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Android Hotfix Release Workflow

paulomeurerzup edited this page Jan 14, 2021 · 7 revisions

This is the complete flow for create a new Android hotfix release.

Overview

Manual

These are steps that must be done manually and are described in details in the release page.

  1. Create release branch
  2. Merge needed PRs to release branch
  3. Create a new release in GitHub

Workflow

In Beagle GitHub Actions we have a workflow called release. This workflow will be triggered every time a push event occurs to any tag in the repository.

You can see it more detailed in the workflow file.

4. Configure environment variables

Setup needed environment variables. These variables are used in fastlane lanes and actions.

5. Execute fastlane deploy lane

Runs fastlane deploy lane.

fastlane

The deploy lane is where we compile and deploy the version. We know that we are deploying an Android hotfix version by the tag name pattern: *.*.*-android.

This lane will end creating a new GitHub release that will overlap the one created at the beginning of this flow.

You can see it more detailed in the Fastfile.

6. git fetch

Update repository references. This is needed because a new branch will be created from the hotfix tag.

7. Create branch

Creates a new branch from the hotfix tag. It's named newReleaseFromTag*.*.*-android.

This branch is created only at the virtual machine executing the workflow. This is the branch that will be used to compile the project modules.

8. Create PGP signature

A PGP signature is required to publish artifacts to the maven central repository. You can read more about this here.

The PGP signature is generated by the maven publish plugin.

The maven publish plugin needs three properties to generate the signature:

signing.keyId=12345678
signing.password=some_password
signing.secretKeyRingFile=/Users/yourusername/.gnupg/secring.gpg

The recommended place to setup these properties is at gradle.properties file at gradle home directory: ~/.gradle/gradle.properties

In this step, we setup these gradle properties. To accomplish this, we call the maven_signing.sh bash script.

The script uses three environment variables declared at the workflow:

  • GPG_KEY_CONTENTS
  • ORG_GRADLE_PROJECT_SIGNINGKEYID
  • ORG_GRADLE_PROJECT_SIGNINGPASSWORD

The values of this variables are stored in our GitHub secrets.

The script does the following tasks:

  1. Create ~/.gradle directory
  2. Write the GPG_KEY_CONTENTS encoded in base64 to the ~/.gradle/release.gpg file
  3. Write the gradle properties to ~/.gradle/gradle.properties file
signing.keyId=ORG_GRADLE_PROJECT_SIGNINGKEYID
signing.password=ORG_GRADLE_PROJECT_SIGNINGPASSWORD
signing.secretKeyRingFile=~/.gradle/release.gpg

9. Compile

Compiles all android modules and generate the artifacts.

10. Upload

Uploads all modules that have maven publish gradle plugin to nexus. This action is accomplished using the uploadArchives gradle task. This task is defined by the maven publish plugin.

11. Generate release notes

Executes release_notes fastlane lane.

This lane uses fastlane-plugin-semantic_release plugin to generate release notes based on the commits made to the release branch.

12. Delete github release

This step is necessary because we don't have permission to edit a github release.

A first github release is manually created along with the hotfix tag (this is the start of a hotfix release process).

13. Create github release

Creates github release notes for generated version, from release notes generated in step 11.