Read the official documentation to setup the keystore: https://docs.flutter.dev/deployment/android#create-an-upload-keystore
If you followed the above documentation you should end up with a local file key.properties
(not comitted to github). This github action
will recreate that file with values inside github actions secrets, for signing the application.
add the base64 version of your upload-keystore.jks as well as the password from the previous step in your repository actions secrets
base64 -i path/to/upload-keystore.jks
You should end up with those values as secrets (you can give them any name).
name: Build and distribute
on:
push:
branches:
- main
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: cedvdb/action-flutter-build-android@v1
with:
keystore-base64: ${{ secrets.ANDROID_RELEASE_KEY }}
keystore-password: "${{ secrets.ANDROID_RELEASE_KEY_PASSWORD }}"
# optionals
build-cmd: flutter build apk --release --flavor dev
working-directory: ./
- name: Archive APK
uses: actions/upload-artifact@v2
with:
name: release-apk
# Try running the build locally with the build command to be sure of this path
path: build/app/outputs/flutter-apk/app-dev-release.apk