2024-03-31 19:15:36 +02:00
|
|
|
name: Set up Flutter
|
|
|
|
description: Setup your runner with Flutter environment
|
|
|
|
author: Alif Rachmawadi
|
2022-01-06 08:40:25 +01:00
|
|
|
branding:
|
2024-03-31 19:15:36 +02:00
|
|
|
icon: maximize
|
|
|
|
color: blue
|
2024-03-31 22:15:17 +02:00
|
|
|
|
2019-08-13 12:11:30 +02:00
|
|
|
inputs:
|
2019-08-16 14:14:55 +02:00
|
|
|
flutter-version:
|
2024-03-31 19:15:36 +02:00
|
|
|
description: The Flutter version to make available on the path
|
2019-08-16 13:30:45 +02:00
|
|
|
required: false
|
2024-03-31 19:15:36 +02:00
|
|
|
default: any
|
2019-08-13 12:11:30 +02:00
|
|
|
channel:
|
2024-03-31 19:15:36 +02:00
|
|
|
description: The Flutter build release channel
|
2019-08-13 12:11:30 +02:00
|
|
|
required: false
|
2024-03-31 19:15:36 +02:00
|
|
|
default: stable
|
2022-01-08 15:55:41 +01:00
|
|
|
cache:
|
2024-03-31 19:15:36 +02:00
|
|
|
description: Cache the Flutter SDK
|
2022-01-08 15:55:41 +01:00
|
|
|
required: false
|
2024-03-31 19:15:36 +02:00
|
|
|
default: "false"
|
2022-01-08 15:55:41 +01:00
|
|
|
cache-key:
|
2024-03-31 19:15:36 +02:00
|
|
|
description: Identifier for the Flutter SDK cache
|
2022-01-08 15:55:41 +01:00
|
|
|
required: false
|
2024-03-31 19:15:36 +02:00
|
|
|
default: "flutter-:os:-:channel:-:version:-:arch:-:hash:"
|
2024-02-13 01:13:38 +01:00
|
|
|
pub-cache-key:
|
2024-03-31 19:15:36 +02:00
|
|
|
description: Identifier for the Dart .pub-cache cache
|
2024-02-13 01:13:38 +01:00
|
|
|
required: false
|
2024-03-31 19:15:36 +02:00
|
|
|
default: "flutter-pub:os:-:channel:-:version:-:arch:-:hash:"
|
2022-01-13 11:10:55 +01:00
|
|
|
cache-path:
|
2024-03-31 19:15:36 +02:00
|
|
|
description: Flutter SDK cache path
|
2022-01-13 11:10:55 +01:00
|
|
|
required: false
|
2024-03-31 19:15:36 +02:00
|
|
|
default: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
|
2024-03-20 05:20:53 +01:00
|
|
|
pub-cache-path:
|
2024-03-31 19:15:36 +02:00
|
|
|
description: Flutter pub cache path
|
2024-03-20 05:20:53 +01:00
|
|
|
required: false
|
2024-03-31 19:15:36 +02:00
|
|
|
default: default
|
2022-04-19 11:08:46 +02:00
|
|
|
architecture:
|
2024-03-31 19:15:36 +02:00
|
|
|
description: The architecture of Flutter SDK executable (x64 or arm64)
|
2022-04-19 11:08:46 +02:00
|
|
|
required: false
|
2024-03-31 19:15:36 +02:00
|
|
|
default: "${{ runner.arch }}"
|
2024-03-31 22:15:17 +02:00
|
|
|
|
2022-09-08 03:41:22 +02:00
|
|
|
outputs:
|
2022-10-13 01:31:27 +02:00
|
|
|
CACHE-KEY:
|
2024-03-31 19:15:36 +02:00
|
|
|
value: "${{ steps.flutter-action.outputs.CACHE-KEY }}"
|
2024-03-31 19:21:19 +02:00
|
|
|
description: Key used to cache the Flutter SDK
|
|
|
|
CACHE-PATH:
|
|
|
|
value: "${{ steps.flutter-action.outputs.CACHE-PATH }}"
|
|
|
|
description: Path to Flutter SDK
|
2022-10-13 01:31:27 +02:00
|
|
|
CHANNEL:
|
2024-03-31 19:15:36 +02:00
|
|
|
value: "${{ steps.flutter-action.outputs.CHANNEL }}"
|
2024-03-31 19:21:19 +02:00
|
|
|
description: The selected Flutter release channel
|
2022-10-13 01:31:27 +02:00
|
|
|
VERSION:
|
2024-03-31 19:15:36 +02:00
|
|
|
value: "${{ steps.flutter-action.outputs.VERSION }}"
|
2024-03-31 19:21:19 +02:00
|
|
|
description: The selected Flutter version
|
2022-10-13 01:31:27 +02:00
|
|
|
ARCHITECTURE:
|
2024-03-31 19:15:36 +02:00
|
|
|
value: "${{ steps.flutter-action.outputs.ARCHITECTURE }}"
|
2024-03-31 19:21:19 +02:00
|
|
|
description: The selected Flutter CPU architecture
|
2024-02-13 01:13:38 +01:00
|
|
|
PUB-CACHE-KEY:
|
2024-03-31 19:15:36 +02:00
|
|
|
value: "${{ steps.flutter-action.outputs.PUB-CACHE-KEY }}"
|
2024-03-31 19:21:19 +02:00
|
|
|
description: Key used to cache the pub dependencies
|
2024-02-13 01:13:38 +01:00
|
|
|
PUB-CACHE-PATH:
|
2024-03-31 19:15:36 +02:00
|
|
|
value: "${{ steps.flutter-action.outputs.PUB-CACHE-PATH }}"
|
2024-03-31 19:21:19 +02:00
|
|
|
description: Path to pub cache
|
2024-03-31 22:15:17 +02:00
|
|
|
|
2019-08-13 12:11:30 +02:00
|
|
|
runs:
|
2024-03-31 19:15:36 +02:00
|
|
|
using: composite
|
2022-01-06 08:40:25 +01:00
|
|
|
steps:
|
2024-03-31 19:21:19 +02:00
|
|
|
- name: Make setup script executable
|
|
|
|
run: chmod +x "$GITHUB_ACTION_PATH/setup.sh"
|
2023-11-01 11:59:30 +01:00
|
|
|
shell: bash
|
2024-03-31 22:15:17 +02:00
|
|
|
|
|
|
|
- name: Set action inputs
|
2024-03-31 19:21:19 +02:00
|
|
|
id: flutter-action
|
2022-07-24 14:19:31 +02:00
|
|
|
shell: bash
|
2024-03-31 22:15:17 +02:00
|
|
|
run: |
|
|
|
|
$GITHUB_ACTION_PATH/setup.sh -p \
|
|
|
|
-c '${{ inputs.cache-path }}' \
|
|
|
|
-k '${{ inputs.cache-key }}' \
|
|
|
|
-d '${{ inputs.pub-cache-path }}' \
|
|
|
|
-l '${{ inputs.pub-cache-key }}' \
|
|
|
|
-n '${{ inputs.flutter-version }}' \
|
|
|
|
-a '${{ inputs.architecture }}' \
|
|
|
|
${{ inputs.channel }}
|
|
|
|
|
2024-03-31 19:21:19 +02:00
|
|
|
- name: Cache Flutter
|
2024-02-05 03:06:33 +01:00
|
|
|
uses: actions/cache@v4
|
2024-03-31 22:15:17 +02:00
|
|
|
if: ${{ inputs.cache == 'true' }}
|
2022-01-08 15:55:41 +01:00
|
|
|
with:
|
2022-10-13 01:31:27 +02:00
|
|
|
path: ${{ steps.flutter-action.outputs.CACHE-PATH }}
|
2024-02-13 01:13:38 +01:00
|
|
|
key: ${{ steps.flutter-action.outputs.CACHE-KEY }}
|
2023-03-21 16:20:05 +01:00
|
|
|
restore-keys: |
|
|
|
|
${{ steps.flutter-action.outputs.CACHE-KEY }}
|
2024-03-31 22:15:17 +02:00
|
|
|
|
2024-03-31 19:21:19 +02:00
|
|
|
- name: Cache pub dependencies
|
2024-02-13 01:13:38 +01:00
|
|
|
uses: actions/cache@v4
|
2024-03-31 22:15:17 +02:00
|
|
|
if: ${{ inputs.cache == 'true' }}
|
2024-02-13 01:13:38 +01:00
|
|
|
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 }}
|
2024-03-31 22:15:17 +02:00
|
|
|
|
|
|
|
- name: Run setup script
|
2022-01-06 08:40:25 +01:00
|
|
|
shell: bash
|
2024-03-31 22:15:17 +02:00
|
|
|
run: |
|
|
|
|
$GITHUB_ACTION_PATH/setup.sh \
|
|
|
|
-c '${{ steps.flutter-action.outputs.CACHE-PATH }}' \
|
|
|
|
-n '${{ steps.flutter-action.outputs.VERSION }}' \
|
|
|
|
-a '${{ steps.flutter-action.outputs.ARCHITECTURE }}' \
|
|
|
|
${{ steps.flutter-action.outputs.CHANNEL }}
|