-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yaml
More file actions
80 lines (64 loc) · 2.25 KB
/
Copy pathaction.yaml
File metadata and controls
80 lines (64 loc) · 2.25 KB
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
name: Setup Flutter by GitPushPray
description: Install Flutter SDK based on OS, arch, and version (supports stable & beta)
author: GitPushPray
branding:
icon: download
color: yellow
inputs:
os:
description: Target OS (linux, macos, windows)
required: false
default: linux
arch:
description: CPU architecture (x64 or arm64)
required: false
default: x64
version:
description: Flutter version (e.g., 3.29.3, 3.32.0-0.2.pre)
required: false
default: stable
is-beta:
description: Whether to use the beta release channel
required: false
default: "false"
runs:
using: composite
steps:
- name: Generate, download, and extract Flutter
shell: bash
run: |
CHANNEL="stable"
EXT="tar.xz"
if [[ "${{ inputs.is-beta }}" == "true" ]]; then
CHANNEL="beta"
fi
VERSION="${{ inputs.version }}"
OS="${{ inputs.os }}"
ARCH="${{ inputs.arch }}"
if [[ "$OS" == "windows" || "$OS" == "macos" ]]; then
EXT="zip"
fi
FILE_NAME="flutter_${OS}"
if [[ "$OS" == "macos" && "$ARCH" == "arm64" ]]; then
FILE_NAME="flutter_macos_arm64"
elif [[ "$OS" == "macos" && "$ARCH" == "x64" ]]; then
FILE_NAME="flutter_macos"
elif [[ "$OS" == "linux" ]]; then
FILE_NAME="flutter_linux"
elif [[ "$OS" == "windows" ]]; then
FILE_NAME="flutter_windows"
fi
FILE_NAME="${FILE_NAME}_${VERSION}-${CHANNEL}.${EXT}"
DOWNLOAD_URL="https://storage.googleapis.com/flutter_infra_release/releases/${CHANNEL}/${OS}/${FILE_NAME}"
echo "Downloading Flutter from $DOWNLOAD_URL"
curl -L -o flutter_sdk.${EXT} "$DOWNLOAD_URL"
echo "Extracting Flutter SDK..."
if [[ "$EXT" == "zip" ]]; then
unzip -q flutter_sdk.zip
else
tar xf flutter_sdk.tar.xz
fi
echo "$GITHUB_WORKSPACE/flutter/bin" >> $GITHUB_PATH
- name: Run Flutter Doctor
shell: bash
run: flutter doctor -v