feat: add reusable Flutter build actions for android, ios, macos, windows, and linux
Update README Actions Table / update-readme (push) Successful in 7s

This commit is contained in:
2026-10-18 13:55:08 -07:00
parent 56dd7d58b3
commit 7a12bb1cc6
11 changed files with 1669 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
# Flutter Build Android
Composite action to configure Android keystore signing, build release AAB and APK artifacts, and optionally upload to Google Play Console and Shorebird.
## Inputs
| Name | Description | Required | Default |
| :--- | :--- | :--- | :--- |
| `working_directory` | Path to the Flutter app package directory. | No | `.` |
| `build_aab` | Whether to build an Android App Bundle (`.aab`). | No | `true` |
| `build_apk` | Whether to build a release APK (`.apk`). | No | `false` |
| `build_args` | Extra arguments passed to `flutter build`. | No | `''` |
| `artifact_prefix` | Optional prefix for copied versioned artifacts in `output_dir`. | No | `''` |
| `output_dir` | Directory to copy versioned artifacts into when `artifact_prefix` is set. | No | `artifacts` |
| `keystore_base64` | Base64-encoded Android release keystore file. | No | `''` |
| `key_alias` | Android signing key alias. | No | `''` |
| `key_password` | Android signing key password. | No | `''` |
| `store_password` | Android keystore password. | No | `''` |
| `google_play_service_account_json` | Google Play service account JSON content. | No | `''` |
| `google_play_service_account_file` | Fallback path to Google Play service account JSON file. | No | `''` |
| `google_play_track` | Google Play track (`internal`, `alpha`, `beta`, `production`). | No | `beta` |
| `google_play_status` | Google Play release status (`completed`, `draft`, `inProgress`, `halted`). | No | `completed` |
| `google_play_script` | Path to the Dart Google Play upload script. | No | `scripts/upload_play_store.dart` |
| `shorebird_token` | Shorebird token for optional Shorebird release. | No | `''` |
| `shorebird_artifact` | Shorebird artifact type (`apk` or `aab`). | No | `apk` |
## Outputs
| Name | Description |
| :--- | :--- |
| `version` | Resolved package version from `pubspec.yaml`. |
| `aab_path` | Path to the built `.aab` file. |
| `apk_path` | Path to the built `.apk` file. |
## Example Usage
```yaml
- name: Build & Release Android
uses: rodydavis/shared-actions/flutter-build-android@main
with:
working_directory: packages/hfw_flutter
build_aab: 'true'
build_apk: 'true'
artifact_prefix: hfw-android
keystore_base64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
key_alias: ${{ secrets.ANDROID_KEY_ALIAS }}
key_password: ${{ secrets.ANDROID_KEY_PASSWORD }}
store_password: ${{ secrets.ANDROID_STORE_PASSWORD }}
google_play_service_account_json: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}
google_play_track: beta
shorebird_token: ${{ secrets.SHOREBIRD_TOKEN }}
```