forked from subosito/flutter-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
56 lines (56 loc) · 2.08 KB
/
action.yml
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
name: 'Flutter action'
description: 'Setup your runner with Flutter environment'
author: 'Alif Rachmawadi'
branding:
icon: 'maximize'
color: 'blue'
inputs:
flutter-version:
description: 'The Flutter version to make available on the path'
required: false
default: 'any'
channel:
description: 'The Flutter build release channel'
required: false
default: 'stable'
cache:
description: 'Cache the Flutter SDK'
required: false
cache-key:
description: 'Identifier for the Flutter SDK cache'
required: false
default: 'flutter'
cache-path:
description: 'Flutter SDK cache path'
required: false
default: ${{ runner.tool_cache }}/flutter
architecture:
description: 'The architecture of Flutter SDK executable (x64 or arm64)'
required: false
default: ${{ runner.arch }}
false-positive-cache:
description: 'Ensure up-to-date Flutter SDK but, Occuring False Positive Cache-hit'
required: false
runs:
using: 'composite'
steps:
- if: ${{ inputs.cache == 'true' && inputs.false-positive-cache == 'true' }}
shell: bash
continue-on-error: true
run: |
os_name=$(echo ${{ runner.os }} | awk '{print tolower($0)}')
manifest_base_url="https://storage.googleapis.com/flutter_infra_release/releases"
manifest_url="$manifest_base_url/releases_$os_name.json"
releases_manifest=$(curl --silent --connect-timeout 15 --retry 5 $manifest_url)
if [[ $OS_NAME == 'windows' ]]; then
shopt -s expand_aliases
alias shasum='sha256sum'
fi
echo "manifest_hash=$(echo -n $release_manifest | shasum | cut -c -7)" >>$GITHUB_ENV
- if: ${{ inputs.cache == 'true' }}
uses: actions/cache@v3
with:
path: ${{ inputs.cache-path }}
key: ${{ inputs.cache-key }}-${{ runner.os }}-${{ inputs.architecture }}-${{ inputs.channel }}-${{ inputs.flutter-version }}-${{ env.manifest_hash }}
- run: $GITHUB_ACTION_PATH/setup.sh -c "${{ inputs.cache-path }}" ${{ inputs.channel }} ${{ inputs.flutter-version }} ${{ inputs.architecture }}
shell: bash