-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
15 additions
and
120 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,121 +1,16 @@ | ||
name: Set up Flutter | ||
description: Setup your runner with Flutter environment | ||
author: Alif Rachmawadi | ||
branding: | ||
icon: maximize | ||
color: blue | ||
- name: Flutter action | ||
uses: subosito/[email protected] | ||
|
||
inputs: | ||
channel: | ||
description: The Flutter build release channel | ||
required: false | ||
default: stable | ||
flutter-version: | ||
description: The Flutter version to make available on the path | ||
required: false | ||
default: "" | ||
flutter-version-file: | ||
description: The pubspec.yaml file with exact Flutter version defined | ||
required: false | ||
default: "" | ||
architecture: | ||
description: The architecture of Flutter SDK executable (x64 or arm64) | ||
required: false | ||
default: "${{ runner.arch }}" | ||
cache: | ||
description: Cache the Flutter SDK | ||
required: false | ||
default: "false" | ||
cache-key: | ||
description: Identifier for the Flutter SDK cache | ||
required: false | ||
default: "" | ||
cache-path: | ||
description: Flutter SDK cache path | ||
required: false | ||
default: "" | ||
pub-cache-key: | ||
description: Identifier for the Dart .pub-cache cache | ||
required: false | ||
default: "" | ||
pub-cache-path: | ||
description: Flutter pub cache path | ||
required: false | ||
default: default | ||
dry-run: | ||
description: If true, get outputs but do not install Flutter | ||
required: false | ||
default: "false" | ||
|
||
outputs: | ||
CHANNEL: | ||
value: "${{ steps.flutter-action.outputs.CHANNEL }}" | ||
description: The selected Flutter release channel | ||
VERSION: | ||
value: "${{ steps.flutter-action.outputs.VERSION }}" | ||
description: The selected Flutter version | ||
ARCHITECTURE: | ||
value: "${{ steps.flutter-action.outputs.ARCHITECTURE }}" | ||
description: The selected Flutter CPU architecture | ||
CACHE-KEY: | ||
value: "${{ steps.flutter-action.outputs.CACHE-KEY }}" | ||
description: Key used to cache the Flutter SDK | ||
CACHE-PATH: | ||
value: "${{ steps.flutter-action.outputs.CACHE-PATH }}" | ||
description: Path to Flutter SDK | ||
PUB-CACHE-KEY: | ||
value: "${{ steps.flutter-action.outputs.PUB-CACHE-KEY }}" | ||
description: Key used to cache the pub dependencies | ||
PUB-CACHE-PATH: | ||
value: "${{ steps.flutter-action.outputs.PUB-CACHE-PATH }}" | ||
description: Path to pub cache | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Make setup script executable | ||
run: chmod +x "$GITHUB_ACTION_PATH/setup.sh" | ||
shell: bash | ||
|
||
- name: Set action inputs | ||
id: flutter-action | ||
shell: bash | ||
run: | | ||
$GITHUB_ACTION_PATH/setup.sh -p \ | ||
-n '${{ inputs.flutter-version }}' \ | ||
-f '${{ inputs.flutter-version-file }}' \ | ||
-a '${{ inputs.architecture }}' \ | ||
-k '${{ inputs.cache-key }}' \ | ||
-c '${{ inputs.cache-path }}' \ | ||
-l '${{ inputs.pub-cache-key }}' \ | ||
-d '${{ inputs.pub-cache-path }}' \ | ||
${{ inputs.channel }} | ||
- name: Cache Flutter | ||
uses: actions/cache@v4 | ||
if: ${{ inputs.cache == 'true' }} | ||
with: | ||
path: ${{ steps.flutter-action.outputs.CACHE-PATH }} | ||
key: ${{ steps.flutter-action.outputs.CACHE-KEY }} | ||
restore-keys: | | ||
${{ steps.flutter-action.outputs.CACHE-KEY }} | ||
- name: Cache pub dependencies | ||
uses: actions/cache@v4 | ||
if: ${{ inputs.cache == 'true' }} | ||
with: | ||
path: ${{ steps.flutter-action.outputs.PUB-CACHE-PATH }} | ||
key: ${{ steps.flutter-action.outputs.PUB-CACHE-KEY }}-${{ hashFiles('**/pubspec.lock') }} | ||
restore-keys: | | ||
${{ steps.flutter-action.outputs.PUB-CACHE-KEY }}-${{ hashFiles('**/pubspec.lock') }} | ||
${{ steps.flutter-action.outputs.PUB-CACHE-KEY }} | ||
- name: Run setup script | ||
shell: bash | ||
if: ${{ inputs.dry-run != 'true' && inputs.dry-run != true }} | ||
run: | | ||
$GITHUB_ACTION_PATH/setup.sh \ | ||
-n '${{ steps.flutter-action.outputs.VERSION }}' \ | ||
-a '${{ steps.flutter-action.outputs.ARCHITECTURE }}' \ | ||
-c '${{ steps.flutter-action.outputs.CACHE-PATH }}' \ | ||
${{ steps.flutter-action.outputs.CHANNEL }} | ||
jobs: | ||
main: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v4 | ||
- name: Set up Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
channel: stable | ||
- run: flutter build windows | ||
|
||
|