-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yaml
157 lines (138 loc) · 4.84 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: General Developer Action
description: Setup your runner with Flutter environment
author: General Developer
branding:
icon: maximize
color: blue
inputs:
architecture:
description: The architecture of Flutter SDK executable (x64 or arm64)
required: false
default: "${{ runner.arch }}"
is_use_cache:
description: Cache the Flutter SDK
required: false
default: "true"
flutter_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: "3.29.0"
flutter_version_file:
description: The pubspec.yaml file with exact Flutter version defined
required: false
default: ""
flutter_cache_key:
description: Identifier for the Flutter SDK cache
required: false
default: "flutter-sdk-cache-${{ runner.os }}"
flutter_pub_cache_key:
description: Identifier for the Flutter SDK cache
required: false
default: "flutter-pub-sdk-cache-${{ runner.os }}"
flutter_git_url:
description: Git clone source
required: false
default: "https://github.com/flutter/flutter.git"
install_dependencies_developer:
description: "Install Dependencies For Developer"
required: false
default: "false"
install_rust:
description: "Install Dependencies Rust"
required: false
default: "false"
install_java:
description: "Install Dependencies For Developer"
required: false
default: "false"
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'
shell: bash
run: choco install yq
- name: Install Dependencies Developer
if: ${{ inputs.install_dependencies_developer == 'true' }}
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt update -y
sudo apt-get install -y wget curl make git zlib1g-dev libssl-dev gperf cmake clang libc++-dev libc++abi-dev php-cli g++ ninja-build pkg-config libgtk-3-dev liblzma-dev xz-utils unzip xvfb openjdk-17-jdk ffmpeg libmpv-dev mpv
fi
# if [ "$RUNNER_OS" == "macOS" ]; then
# fi
if [ "$RUNNER_OS" == "Windows" ]; then
choco install yq
choco install make
fi
- name: Instaall Java
if: ${{ inputs.install_java == 'true' }}
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "adopt"
- name: Make setup script executable
shell: bash
run: chmod +x "$GITHUB_ACTION_PATH/setup.sh"
- name: Set action inputs
id: general-developer-action
shell: bash
run: |
$GITHUB_ACTION_PATH/setup.sh -p \
-n '${{ inputs.flutter_version }}' \
-f '${{ inputs.flutter_version_file }}' \
-a '${{ inputs.architecture }}' \
-k '${{ inputs.flutter_cache_key }}' \
-c '${{ runner.tool_cache }}/${{ inputs.flutter_cache_key }}' \
-l '${{ inputs.flutter_pub_cache_key }}' \
-d '${{ runner.tool_cache }}/${{ inputs.flutter_pub_cache_key }}' \
-g '${{ inputs.flutter_git_url }}' \
${{ inputs.flutter_channel }}
- name: Cache Flutter
uses: actions/[email protected]
if: ${{ inputs.is_use_cache == 'true' }}
with:
path: ${{ runner.tool_cache }}/${{ inputs.flutter_cache_key }}
key: ${{ inputs.flutter_cache_key }}
restore-keys: |
${{ inputs.flutter_cache_key }}
- name: Cache pub dependencies
uses: actions/[email protected]
if: ${{ inputs.is_use_cache == 'true' }}
with:
path: ${{ runner.tool_cache }}/${{ inputs.flutter_pub_cache_key }}
key: ${{ inputs.flutter_pub_cache_key }}
restore-keys: |
${{ inputs.flutter_pub_cache_key }}
- name: Run setup script
shell: bash
run: |
$GITHUB_ACTION_PATH/setup.sh \
-n '${{ inputs.flutter_version }}' \
-a '${{ inputs.architecture }}' \
-c '${{ runner.tool_cache }}/${{ inputs.flutter_cache_key }}' \
${{ inputs.flutter_channel }}
- name: Set Flutter enable devices
shell: bash
continue-on-error: true
run: |
flutter config --enable-web
flutter config --enable-linux-desktop
flutter config --enable-macos-desktop
flutter config --enable-windows-desktop
flutter config --enable-android
flutter config --enable-ios
- name: Install latest Rust Nightly
if: ${{ inputs.install_rust == 'true' }}
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: rustfmt, clippy