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 2727 strategy :
2828 matrix :
2929 operating-system :
30- [ubuntu-latest, windows-latest, macos-latest, macos-13]
30+ - ubuntu-latest
31+ - windows-latest
32+ - macos-latest
33+ - macos-13
3134 channel : [stable, beta, master]
3235 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
3340 include :
3441 - operating-system : ubuntu-latest
3542 channel : main
4249 with :
4350 channel : ${{ matrix.channel }}
4451 dry-run : ${{ matrix.dry-run }}
52+ git-source : ${{ matrix.git-source }}
4553 - name : Echo outputs
4654 run : |
4755 echo RUNNER-OS=${{ runner.os }}
Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ inputs:
4646 description : If true, get outputs but do not install Flutter
4747 required : false
4848 default : " false"
49+ git-source :
50+ description : Git clone source
51+ required : false
52+ default : " https://github.com/flutter/flutter.git"
4953
5054outputs :
5155 CHANNEL :
@@ -69,6 +73,9 @@ outputs:
6973 PUB-CACHE-PATH :
7074 value : " ${{ steps.flutter-action.outputs.PUB-CACHE-PATH }}"
7175 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
7279
7380runs :
7481 using : composite
97104 -c '${{ inputs.cache-path }}' \
98105 -l '${{ inputs.pub-cache-key }}' \
99106 -d '${{ inputs.pub-cache-path }}' \
107+ -g '${{ inputs.git-source }}' \
100108 ${{ inputs.channel }}
101109
102110 - name : Cache Flutter
Original file line number Diff line number Diff line change @@ -78,8 +78,9 @@ TEST_MODE=false
7878ARCH=" "
7979VERSION=" "
8080VERSION_FILE=" "
81+ GIT_SOURCE=" "
8182
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
8384 case " $flag " in
8485 c) CACHE_PATH=" $OPTARG " ;;
8586 k) CACHE_KEY=" $OPTARG " ;;
@@ -96,6 +97,7 @@ while getopts 'tc:k:d:l:pa:n:f:' flag; do
9697 exit 1
9798 fi
9899 ;;
100+ g) GIT_SOURCE=" $OPTARG " ;;
99101 ? ) exit 2 ;;
100102 esac
101103done
@@ -121,6 +123,7 @@ CHANNEL="${ARR_CHANNEL[0]:-}"
121123[ -z " $CACHE_KEY " ] && CACHE_KEY=" flutter-:os:-:channel:-:version:-:arch:-:hash:"
122124[ -z " $PUB_CACHE_KEY " ] && PUB_CACHE_KEY=" flutter-pub-:os:-:channel:-:version:-:arch:-:hash:"
123125[ -z " $PUB_CACHE_PATH " ] && PUB_CACHE_PATH=" default"
126+ [ -z " $GIT_SOURCE " ] && GIT_SOURCE=" https://github.com/flutter/flutter.git"
124127
125128# `PUB_CACHE` is what Dart and Flutter looks for in the environment, while
126129# `PUB_CACHE_PATH` is passed in from the action.
213216
214217if [ ! -x " $CACHE_PATH /bin/flutter" ]; then
215218 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 "
217220 if [ " $VERSION " != " any" ]; then
218221 git config --global --add safe.directory " $CACHE_PATH "
219222 (cd " $CACHE_PATH " && git checkout " $VERSION " )
You can’t perform that action at this time.
0 commit comments