Compare commits

..

2 Commits

Author SHA1 Message Date
atishoo
395322a6cd use env if it existed (#360) 2025-06-10 09:21:26 +02:00
Christer Eliasi-Swahn
02d6ac3427 perf: Only install yq on Windows if used (#362) 2025-06-09 09:54:01 +02:00
3 changed files with 24 additions and 5 deletions

View File

@@ -64,8 +64,8 @@ steps:
>
> Using `flutter-version-file` requires [`yq`](https://github.com/mikefarah/yq),
> which is not pre-installed in `windows` runners. Fortunately, since version
> 2.18.0, this action installs `yq` automatically, so no action is required from
> you.
> 2.18.0, this action installs `yq` automatically if `flutter-version-file`
> is specified, so no action is required from you.
### Use latest release for particular channel
@@ -122,6 +122,24 @@ steps:
- run: flutter --version
```
### Use a Flutter mirror by set ENV
You can get more infomation from [Flutter official docs](https://docs.flutter.dev/community/china).
```yaml
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Set up Flutter
env:
FLUTTER_STORAGE_BASE_URL: https://storage.flutter-io.cn
uses: subosito/flutter-action@v2
with:
channel: master
flutter-version: 5b12b74 # tag, commit or branch
- run: flutter --version
```
### Use alternative Flutter repository
This action supports "alternative Flutters" in addition to the official

View File

@@ -80,11 +80,12 @@ outputs:
runs:
using: composite
steps:
# This is a cross-platform composite action that needs yq.
# This is a cross-platform composite action that needs yq in order to parse
# the pubspec.yaml file.
# 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'
if: runner.os == 'Windows' && inputs.flutter-version-file != ''
run: choco install yq
shell: bash

View File

@@ -12,7 +12,7 @@ fi
OS_NAME=$(echo "$RUNNER_OS" | awk '{print tolower($0)}')
ARCH_NAME=$(echo "$RUNNER_ARCH" | awk '{print tolower($0)}')
MANIFEST_BASE_URL="https://storage.googleapis.com/flutter_infra_release/releases"
MANIFEST_BASE_URL="${FLUTTER_STORAGE_BASE_URL:-https://storage.googleapis.com}/flutter_infra_release/releases"
MANIFEST_JSON_PATH="releases_$OS_NAME.json"
MANIFEST_URL="$MANIFEST_BASE_URL/$MANIFEST_JSON_PATH"