File tree Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 27
27
strategy :
28
28
matrix :
29
29
operating-system :
30
- [ubuntu-latest, windows-latest, macos-latest, macos-13]
30
+ - ubuntu-latest
31
+ - windows-latest
32
+ - macos-latest
33
+ - macos-13
31
34
channel : [stable, beta, master]
32
35
dry-run : [true, false]
36
+ git-source :
37
+ - https://github.com/flutter/flutter.git
38
+ - https://github.com/Flutter-Foundation/flutter.git
39
+ - https://gitee.com/harmonycommando_flutter/flutter.git
33
40
include :
34
41
- operating-system : ubuntu-latest
35
42
channel : main
42
49
with :
43
50
channel : ${{ matrix.channel }}
44
51
dry-run : ${{ matrix.dry-run }}
52
+ git-source : ${{ matrix.git-source }}
45
53
- name : Echo outputs
46
54
run : |
47
55
echo RUNNER-OS=${{ runner.os }}
Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ inputs:
46
46
description : If true, get outputs but do not install Flutter
47
47
required : false
48
48
default : " false"
49
+ git-source :
50
+ description : Git clone source
51
+ required : false
52
+ default : " https://github.com/flutter/flutter.git"
49
53
50
54
outputs :
51
55
CHANNEL :
@@ -69,6 +73,9 @@ outputs:
69
73
PUB-CACHE-PATH :
70
74
value : " ${{ steps.flutter-action.outputs.PUB-CACHE-PATH }}"
71
75
description : Path to pub cache
76
+ GIT_SOURCE :
77
+ value : " ${{ steps.flutter-action.outputs.GIT_SOURCE }}"
78
+ description : Git source of Flutter SDK repository to clone
72
79
73
80
runs :
74
81
using : composite
97
104
-c '${{ inputs.cache-path }}' \
98
105
-l '${{ inputs.pub-cache-key }}' \
99
106
-d '${{ inputs.pub-cache-path }}' \
107
+ -g '${{ inputs.git-source }}' \
100
108
${{ inputs.channel }}
101
109
102
110
- name : Cache Flutter
Original file line number Diff line number Diff line change @@ -78,8 +78,9 @@ TEST_MODE=false
78
78
ARCH=" "
79
79
VERSION=" "
80
80
VERSION_FILE=" "
81
+ GIT_SOURCE=" "
81
82
82
- while getopts ' tc:k:d:l:pa:n:f:' flag; do
83
+ while getopts ' tc:k:d:l:pa:n:f:g: ' flag; do
83
84
case " $flag " in
84
85
c) CACHE_PATH=" $OPTARG " ;;
85
86
k) CACHE_KEY=" $OPTARG " ;;
@@ -96,6 +97,7 @@ while getopts 'tc:k:d:l:pa:n:f:' flag; do
96
97
exit 1
97
98
fi
98
99
;;
100
+ g) GIT_SOURCE=" $OPTARG " ;;
99
101
? ) exit 2 ;;
100
102
esac
101
103
done
@@ -121,6 +123,7 @@ CHANNEL="${ARR_CHANNEL[0]:-}"
121
123
[ -z " $CACHE_KEY " ] && CACHE_KEY=" flutter-:os:-:channel:-:version:-:arch:-:hash:"
122
124
[ -z " $PUB_CACHE_KEY " ] && PUB_CACHE_KEY=" flutter-pub-:os:-:channel:-:version:-:arch:-:hash:"
123
125
[ -z " $PUB_CACHE_PATH " ] && PUB_CACHE_PATH=" default"
126
+ [ -z " $GIT_SOURCE " ] && GIT_SOURCE=" https://github.com/flutter/flutter.git"
124
127
125
128
# `PUB_CACHE` is what Dart and Flutter looks for in the environment, while
126
129
# `PUB_CACHE_PATH` is passed in from the action.
213
216
214
217
if [ ! -x " $CACHE_PATH /bin/flutter" ]; then
215
218
if [ " $CHANNEL " = " master" ] || [ " $CHANNEL " = " main" ]; then
216
- git clone -b " $CHANNEL " https://github.com/flutter/flutter.git " $CACHE_PATH "
219
+ git clone -b " $CHANNEL " " $GIT_SOURCE " " $CACHE_PATH "
217
220
if [ " $VERSION " != " any" ]; then
218
221
git config --global --add safe.directory " $CACHE_PATH "
219
222
(cd " $CACHE_PATH " && git checkout " $VERSION " )
You can’t perform that action at this time.
0 commit comments