Skip to content

Instantly share code, notes, and snippets.

@wonderkidshihab
Last active January 29, 2024 10:03
Show Gist options
  • Save wonderkidshihab/08b507d6ed4f48cb5854ea6407e4c89f to your computer and use it in GitHub Desktop.
Save wonderkidshihab/08b507d6ed4f48cb5854ea6407e4c89f to your computer and use it in GitHub Desktop.

Flutter Build Automation

Generate apk and aab file from your sourcecode automatically using github actions

Steps:

  1. Create folder .github/workflows/ on your projects root folder
  2. Add a file named flutter_build.yml
  3. Paste the above code into that file.
  4. Add the file to your git, make a commit and push it.

Now whenever you push a new commit to your master branch you will get .apk and .aab file into your github actions tab in Github.

Follow me on Github Facebook Twitter

# Flutter build automation usign github actions.
on:
push:
branch: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.0.5'
- run: flutter pub get
- run: flutter build apk
- run: flutter build appbundle
- uses: actions/upload-artifact@v1
with:
name: release-apk
path: build/app/outputs/apk/release/app-release.apk
- uses: actions/upload-artifact@v1
with:
name: release-bundle
path: build/app/outputs/bundle/release/app-release.aab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment