Set up Flutter SDK for GitHub Actions.
- Pure TypeScript — No external tools. Consistent behavior across Linux, macOS, and Windows.
- SHA-256 verification — Every downloaded archive is verified against the official manifest to detect tampering.
- Automated maintenance — Dependencies are kept up to date via Dependabot with auto-merge enabled for patch and minor updates.
See action.yml for the full list of inputs and outputs.
steps:
- uses: actions/checkout@v6
- uses: koji-1009/setup-flutter@v1
- run: flutter --versionZero configuration installs the latest stable Flutter SDK with caching enabled.
- uses: koji-1009/setup-flutter@v1
with:
flutter-version: '3.29.0'Supports exact versions, ranges (3.x, 3.29.x), and constraints (>=3.29.0 <4.0.0).
- uses: koji-1009/setup-flutter@v1
with:
channel: beta# From pubspec.yaml sdk constraint
- uses: koji-1009/setup-flutter@v1
with:
flutter-version-file: pubspec.yaml
# From .fvmrc
- uses: koji-1009/setup-flutter@v1
with:
flutter-version-file: .fvmrc- uses: koji-1009/setup-flutter@v1
with:
flutter-version-file: .fvmrc
fvm-flavor: production- uses: koji-1009/setup-flutter@v1
with:
architecture: arm64Auto-detected if omitted. Supported values: x64, arm64.
strategy:
matrix:
channel: [stable, beta]
steps:
- uses: actions/checkout@v6
- uses: koji-1009/setup-flutter@v1
with:
channel: ${{ matrix.channel }}
- run: flutter testSDK and pub caches are enabled by default. To disable:
- uses: koji-1009/setup-flutter@v1
with:
cache-sdk: false
cache-pub: falsePub caching requires pubspec.lock in the working directory.
Resolve version without installing. Useful for checking available versions in CI.
- uses: koji-1009/setup-flutter@v1
id: flutter
with:
flutter-version: '3.x'
dry-run: true
- run: echo "${{ steps.flutter.outputs.flutter-version }}"Install from a git repository instead of release archives:
# master branch
- uses: koji-1009/setup-flutter@v1
with:
git-source: git
channel: master
# Custom fork
- uses: koji-1009/setup-flutter@v1
with:
git-source: git
git-source-url: https://github.com/user/flutter-fork.git
flutter-version: my-branchNote: Specifying a commit hash as
flutter-versionwithgit-source: gitrequires a full clone (no--depth 1), which is slower. When using git source,dart-versionoutput isunknownsince it is not available from the git metadata.
env:
FLUTTER_STORAGE_BASE_URL: https://storage.flutter-io.cn
steps:
- uses: koji-1009/setup-flutter@v1The action sets the following outputs:
| Output | Description |
|---|---|
flutter-version |
Installed Flutter version |
dart-version |
Included Dart SDK version (unknown in git mode) |
channel |
Resolved channel |
cache-sdk-hit |
Whether SDK cache was restored |
cache-pub-hit |
Whether pub cache was restored |
architecture |
Resolved CPU architecture |
Inspired by subosito/flutter-action and flutter-actions/setup-flutter.
MIT