-
-
Notifications
You must be signed in to change notification settings - Fork 205
/
action.yaml
137 lines (129 loc) · 4.46 KB
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Set up Flutter
description: Setup your runner with Flutter environment
author: Alif Rachmawadi
branding:
icon: maximize
color: blue
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"
git-source:
description: Git clone source
required: false
default: "https://github.com/flutter/flutter.git"
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
GIT_SOURCE:
value: "${{ steps.flutter-action.outputs.GIT_SOURCE }}"
description: Git source of Flutter SDK repository to clone
runs:
using: composite
steps:
# This is a cross-platform composite action that needs yq.
# It's not preinstalled on Windows runners.
# See https://github.com/actions/runner-images/issues/7443#issuecomment-1514597691
- name: Make yq tool available on Windows runners
if: runner.os == 'Windows'
run: choco install yq
shell: bash
- 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 }}' \
-g '${{ inputs.git-source }}' \
${{ 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 }}