Flutter Android CI #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Flutter Android CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Set up Flutter with explicit version | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.24.2.' # Updated to match Dart SDK requirement | |
# Clear Flutter/Dart Cache | |
- name: Clear Flutter/Dart Cache | |
run: | | |
flutter clean | |
rm -rf ~/.pub-cache | |
# Verify the installed Flutter and Dart versions | |
- name: Check Flutter and Dart Versions | |
run: | | |
flutter --version | |
dart --version | |
# Install dependencies | |
- name: Install dependencies | |
run: flutter pub get | |
# Build APK | |
- name: Build APK | |
run: flutter build apk --release | |
# Build AAB | |
- name: Build AAB | |
run: flutter build appbundle --release | |
# Upload APK artifact | |
- name: Upload APK | |
uses: actions/upload-artifact@v3 | |
with: | |
name: app-release.apk | |
path: build/app/outputs/apk/release/app-release.apk | |
# Upload AAB artifact | |
- name: Upload AAB | |
uses: actions/upload-artifact@v3 | |
with: | |
name: app-release.aab | |
path: build/app/outputs/bundle/release/app-release.aab |