diff --git a/README.md b/README.md index 494f807..6497084 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ This repository contains reusable composite actions for CI/CD workflows across o | [Enforce Flutter Version Constraint](./enforce-flutter-version) | Scans all pubspec.yaml files to ensure they use the required Flutter SDK constraint. | `rodydavis/shared-actions/enforce-flutter-version@main` | | [Run Buildifier](./run-buildifier) | Downloads and runs buildifier on Starlark files. | `rodydavis/shared-actions/run-buildifier@main` | | [Setup Bazel (Bazelisk)](./setup-bazel) | Installs Node, Bazelisk, and configures Git for private SSH dependencies. | `rodydavis/shared-actions/setup-bazel@main` | +| [Setup Flutter](./setup-flutter) | Cross-platform setup for Flutter with caching on macOS, Windows, and Linux. | `rodydavis/shared-actions/setup-flutter@main` | diff --git a/setup-flutter/README.md b/setup-flutter/README.md new file mode 100644 index 0000000..df0e96f --- /dev/null +++ b/setup-flutter/README.md @@ -0,0 +1,42 @@ +# Setup Flutter + +Cross-platform composite action to set up the Flutter SDK with automated caching on macOS, Windows, and Linux. Supports local Git mirrors with automatic fallback to upstream GitHub. + +## Features + +- **Multi-OS Support**: Native setup for macOS (Apple Silicon & Intel), Windows (PowerShell), and Linux. +- **Git Mirror & Fallback**: Clones from local Gitea Flutter mirror (`https://git.rodydavis.dev/rodydavis/flutter.git`) with automatic fallback to `https://github.com/flutter/flutter.git`. +- **SDK Caching**: Uses `actions/cache@v3` to cache the full Flutter SDK directory across workflow runs based on OS, CPU architecture, and version. +- **Desktop Windowing**: Automatically configures desktop windowing support and exports Flutter to `$GITHUB_PATH`. + +## Inputs + +| Name | Description | Required | Default | +| :--- | :--- | :--- | :--- | +| `version` | Flutter channel, tag, or branch (e.g., `master`, `stable`, `3.29.0`). | No | `master` | +| `mirror_url` | Git repository URL for Flutter SDK mirror. | No | `https://git.rodydavis.dev/rodydavis/flutter.git` | +| `git_token` | Gitea token for authenticated git mirror access. | No | `''` | +| `cache` | Enable Flutter SDK caching across CI runs. | No | `true` | +| `enable_windowing` | Enable desktop windowing and platform configs. | No | `true` | + +## Example Usage + +### Basic Usage (Master Channel) + +```yaml +- name: Set up Flutter + uses: rodydavis/shared-actions/setup-flutter@main + with: + version: master + git_token: ${{ secrets.GIT_TOKEN }} +``` + +### Specific Version Tag with Caching + +```yaml +- name: Set up Flutter 3.29.0 + uses: rodydavis/shared-actions/setup-flutter@main + with: + version: '3.29.0' + cache: 'true' +```