Member-only story

Flutter & Github actions for a signed APK

Build and test your flutter app with github actions

Daniel Llewellyn
3 min readNov 27, 2019

For the full solution, see:

Let’s begin. Navigate to your github project, and click the actions tab

Click ‘New workflow’

Click setup a workflow yourself

Copy the following code into the editor window

And click ‘Start commit’

Generate a signed APK — Android

This works fine, for the simple use cases of run flutter build as an APK and testing. If we want to generate a signed APK and have that artifacted. We need to add some extra steps.

First, if you haven’t got one already generate a signing key

Mac

keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias release

Windows

keytool -genkey -v -keystore c:/Users/USER_NAME/key.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias release

Remember your key password, your alias name and your alias password. Copy key.jks to <yourproject>/android

Open up app/build.gradle and find the line that says

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}

Replace them with this

signingConfigs {
release {
storeFile file("../key.jks")
storePassword = "$System.env.KEY_PASSWORD"
keyAlias = "release"
keyPassword =…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Responses (3)

Write a response