This guide explains how to set up automated APK building and deployment for your Flutter Notes app using GitHub Actions.
You'll need to configure these GitHub repository secrets:
| Secret Name | Description | Required |
|---|---|---|
KEYSTORE_BASE64 | Base64 encoded keystore file | Yes (for signed builds) |
KEYSTORE_PASSWORD | Keystore password | Yes (for signed builds) |
KEY_PASSWORD | Key password | Yes (for signed builds) |
KEY_ALIAS | Key alias name | Yes (for signed builds) |
# Create a new keystore
keytool -genkey -v -keystore release-keystore.jks \
-keyalg RSA -keysize 2048 -validity 10000 \
-alias release-key
# Convert keystore to base64 for GitHub secrets
base64 -i release-keystore.jks | pbcopy # macOS
base64 -i release-keystore.jks # Linux
base64 -w 0 release-keystore.jks # Linux (single line)
KEYSTORE_BASE64: [paste the base64 encoded keystore]
KEYSTORE_PASSWORD: [your keystore password]
KEY_PASSWORD: [your key password]
KEY_ALIAS: release-key
Copy the workflow files to your repository:
.github/workflows/build-release-apk.yml.github/workflows/build-debug-apk.ymlEnsure your android/app/build.gradle is configured for signing:
signingConfigs {
release {
if (keystorePropertiesFile.exists()) {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
}