Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62f096cacd | ||
|
|
844082558d | ||
|
|
14bf5302ef | ||
|
|
02b923c0e1 | ||
|
|
aa6d9b9844 |
15
.github/workflows/workflow.yml
vendored
15
.github/workflows/workflow.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
|||||||
lint_shellcheck:
|
lint_shellcheck:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: ludeeus/action-shellcheck@master
|
- uses: ludeeus/action-shellcheck@master
|
||||||
test_channel:
|
test_channel:
|
||||||
runs-on: ${{ matrix.operating-system }}
|
runs-on: ${{ matrix.operating-system }}
|
||||||
@@ -20,14 +20,20 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
channel: [stable, beta, master]
|
channel: [stable, beta, master]
|
||||||
|
include:
|
||||||
|
- operating-system: ubuntu-latest
|
||||||
|
channel: main
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- id: flutter-action
|
- id: flutter-action
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
channel: ${{ matrix.channel }}
|
channel: ${{ matrix.channel }}
|
||||||
- name: Echo outputs
|
- name: Echo outputs
|
||||||
run: |
|
run: |
|
||||||
|
echo RUNNER-OS=${{ runner.os }}
|
||||||
|
echo RUNNER-ARCH=${{ runner.arch }}
|
||||||
|
|
||||||
echo CACHE-PATH=${{ steps.flutter-action.outputs.CACHE-PATH }}
|
echo CACHE-PATH=${{ steps.flutter-action.outputs.CACHE-PATH }}
|
||||||
echo CACHE-KEY=${{ steps.flutter-action.outputs.CACHE-KEY }}
|
echo CACHE-KEY=${{ steps.flutter-action.outputs.CACHE-KEY }}
|
||||||
echo CHANNEL=${{ steps.flutter-action.outputs.CHANNEL }}
|
echo CHANNEL=${{ steps.flutter-action.outputs.CHANNEL }}
|
||||||
@@ -44,10 +50,11 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
channel: stable
|
channel: stable
|
||||||
|
flutter-version: '3.10.6'
|
||||||
cache: true
|
cache: true
|
||||||
- run: dart --version
|
- run: dart --version
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -56,7 +63,7 @@ jobs:
|
|||||||
test_print_output:
|
test_print_output:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- run: ./setup.sh -t -p | grep 'stable'
|
- run: ./setup.sh -t -p | grep 'stable'
|
||||||
shell: bash
|
shell: bash
|
||||||
- run: ./setup.sh -t -p | grep '3.7.7'
|
- run: ./setup.sh -t -p | grep '3.7.7'
|
||||||
|
|||||||
52
README.md
52
README.md
@@ -8,10 +8,10 @@ Use specific version and channel:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: subosito/flutter-action@v2
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
flutter-version: '3.7.7'
|
flutter-version: '3.16.9'
|
||||||
channel: 'stable'
|
channel: 'stable'
|
||||||
- run: flutter --version
|
- run: flutter --version
|
||||||
```
|
```
|
||||||
@@ -20,10 +20,10 @@ Use latest release for particular channel:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: subosito/flutter-action@v2
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: 'stable' # or: 'beta', 'dev' or 'master'
|
channel: 'stable' # or: 'beta', 'dev', 'master' (or 'main')
|
||||||
- run: flutter --version
|
- run: flutter --version
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ Use latest release for particular version and/or channel:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: subosito/flutter-action@v2
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
flutter-version: '1.22.x'
|
flutter-version: '1.22.x'
|
||||||
@@ -43,10 +43,10 @@ Use particular version on any channel:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: subosito/flutter-action@v2
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
flutter-version: '2.x'
|
flutter-version: '3.x'
|
||||||
channel: 'any'
|
channel: 'any'
|
||||||
- run: flutter --version
|
- run: flutter --version
|
||||||
```
|
```
|
||||||
@@ -55,7 +55,7 @@ Use particular git reference on master channel:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: subosito/flutter-action@v2
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
flutter-version: '5b12b74' # tag, commit or branch
|
flutter-version: '5b12b74' # tag, commit or branch
|
||||||
@@ -67,14 +67,10 @@ Build Android APK and app bundle:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-java@v2
|
|
||||||
with:
|
|
||||||
distribution: 'zulu'
|
|
||||||
java-version: '11'
|
|
||||||
- uses: subosito/flutter-action@v2
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
flutter-version: '3.7.7'
|
flutter-version: '3.16.9'
|
||||||
- run: flutter pub get
|
- run: flutter pub get
|
||||||
- run: flutter test
|
- run: flutter test
|
||||||
- run: flutter build apk
|
- run: flutter build apk
|
||||||
@@ -88,11 +84,10 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: subosito/flutter-action@v2
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: 'stable'
|
channel: 'stable'
|
||||||
architecture: x64
|
|
||||||
- run: flutter pub get
|
- run: flutter pub get
|
||||||
- run: flutter test
|
- run: flutter test
|
||||||
- run: flutter build ios --release --no-codesign
|
- run: flutter build ios --release --no-codesign
|
||||||
@@ -102,7 +97,7 @@ Build for the web:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: subosito/flutter-action@v2
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: 'stable'
|
channel: 'stable'
|
||||||
@@ -118,11 +113,10 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: subosito/flutter-action@v2
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: 'beta'
|
channel: 'stable'
|
||||||
- run: flutter config --enable-windows-desktop
|
|
||||||
- run: flutter build windows
|
- run: flutter build windows
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -133,14 +127,13 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: subosito/flutter-action@v2
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: 'stable'
|
channel: 'stable'
|
||||||
- run: |
|
- run: |
|
||||||
sudo apt-get update -y
|
sudo apt-get update -y
|
||||||
sudo apt-get install -y ninja-build libgtk-3-dev
|
sudo apt-get install -y ninja-build libgtk-3-dev
|
||||||
- run: flutter config --enable-linux-desktop
|
|
||||||
- run: flutter build linux
|
- run: flutter build linux
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -151,12 +144,10 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: subosito/flutter-action@v2
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: 'stable'
|
channel: 'stable'
|
||||||
architecture: x64
|
|
||||||
- run: flutter config --enable-macos-desktop
|
|
||||||
- run: flutter build macos
|
- run: flutter build macos
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -164,18 +155,19 @@ Integration with `actions/cache`:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: subosito/flutter-action@v2
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: 'stable'
|
channel: 'stable'
|
||||||
cache: true
|
cache: true
|
||||||
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache
|
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache
|
||||||
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path
|
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path
|
||||||
architecture: x64 # optional, x64 or arm64
|
pub-cache-key: 'flutter-pub:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache of dart pub get dependencies
|
||||||
|
pub-cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path
|
||||||
- run: flutter --version
|
- run: flutter --version
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: `cache-key` and `cache-path` has support for several dynamic values:
|
Note: `cache-key`, `pub-cache-key`, and `cache-path` has support for several dynamic values:
|
||||||
|
|
||||||
- `:os:`
|
- `:os:`
|
||||||
- `:channel:`
|
- `:channel:`
|
||||||
@@ -188,7 +180,7 @@ Use outputs from `flutter-action`:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- id: flutter-action
|
- id: flutter-action
|
||||||
uses: subosito/flutter-action@v2
|
uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
@@ -199,5 +191,7 @@ steps:
|
|||||||
echo CHANNEL=${{ steps.flutter-action.outputs.CHANNEL }}
|
echo CHANNEL=${{ steps.flutter-action.outputs.CHANNEL }}
|
||||||
echo VERSION=${{ steps.flutter-action.outputs.VERSION }}
|
echo VERSION=${{ steps.flutter-action.outputs.VERSION }}
|
||||||
echo ARCHITECTURE=${{ steps.flutter-action.outputs.ARCHITECTURE }}
|
echo ARCHITECTURE=${{ steps.flutter-action.outputs.ARCHITECTURE }}
|
||||||
|
echo PUB-CACHE-PATH=${{ steps.flutter-action.outputs.PUB-CACHE-PATH }}
|
||||||
|
echo PUB-CACHE-KEY=${{ steps.flutter-action.outputs.PUB-CACHE-KEY }}
|
||||||
shell: bash
|
shell: bash
|
||||||
```
|
```
|
||||||
|
|||||||
25
action.yml
25
action.yml
@@ -16,11 +16,15 @@ inputs:
|
|||||||
cache:
|
cache:
|
||||||
description: 'Cache the Flutter SDK'
|
description: 'Cache the Flutter SDK'
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: 'false'
|
||||||
cache-key:
|
cache-key:
|
||||||
description: 'Identifier for the Flutter SDK cache'
|
description: 'Identifier for the Flutter SDK cache'
|
||||||
required: false
|
required: false
|
||||||
default: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
|
default: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
|
||||||
|
pub-cache-key:
|
||||||
|
description: 'Identifier for the Dart .pub-cache cache'
|
||||||
|
required: false
|
||||||
|
default: 'flutter-pub:os:-:channel:-:version:-:arch:-:hash:'
|
||||||
cache-path:
|
cache-path:
|
||||||
description: 'Flutter SDK cache path'
|
description: 'Flutter SDK cache path'
|
||||||
required: false
|
required: false
|
||||||
@@ -40,21 +44,32 @@ outputs:
|
|||||||
value: '${{ steps.flutter-action.outputs.VERSION }}'
|
value: '${{ steps.flutter-action.outputs.VERSION }}'
|
||||||
ARCHITECTURE:
|
ARCHITECTURE:
|
||||||
value: '${{ steps.flutter-action.outputs.ARCHITECTURE }}'
|
value: '${{ steps.flutter-action.outputs.ARCHITECTURE }}'
|
||||||
|
PUB-CACHE-KEY:
|
||||||
|
value: '${{ steps.flutter-action.outputs.PUB-CACHE-KEY }}'
|
||||||
|
PUB-CACHE-PATH:
|
||||||
|
value: '${{ steps.flutter-action.outputs.PUB-CACHE-PATH }}'
|
||||||
runs:
|
runs:
|
||||||
using: 'composite'
|
using: 'composite'
|
||||||
steps:
|
steps:
|
||||||
- run: chmod +x $GITHUB_ACTION_PATH/setup.sh
|
- run: chmod +x $GITHUB_ACTION_PATH/setup.sh
|
||||||
shell: bash
|
shell: bash
|
||||||
- id: flutter-action
|
- id: flutter-action
|
||||||
run: $GITHUB_ACTION_PATH/setup.sh -p -c '${{ inputs.cache-path }}' -k '${{ inputs.cache-key }}' -n '${{ inputs.flutter-version }}' -a '${{ inputs.architecture }}' ${{ inputs.channel }}
|
run: $GITHUB_ACTION_PATH/setup.sh -p -c '${{ inputs.cache-path }}' -k '${{ inputs.cache-key }}' -d '${{ inputs.pub-cache-key }}' -n '${{ inputs.flutter-version }}' -a '${{ inputs.architecture }}' ${{ inputs.channel }}
|
||||||
shell: bash
|
shell: bash
|
||||||
- if: ${{ inputs.cache == 'true' }}
|
- if: ${{ inputs.cache == 'true' }}
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.flutter-action.outputs.CACHE-PATH }}
|
path: ${{ steps.flutter-action.outputs.CACHE-PATH }}
|
||||||
key: ${{ steps.flutter-action.outputs.CACHE-KEY }}-${{ hashFiles('**/pubspec.lock') }}
|
key: ${{ steps.flutter-action.outputs.CACHE-KEY }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ steps.flutter-action.outputs.CACHE-KEY }}-${{ hashFiles('**/pubspec.lock') }}
|
|
||||||
${{ steps.flutter-action.outputs.CACHE-KEY }}
|
${{ steps.flutter-action.outputs.CACHE-KEY }}
|
||||||
|
- if: ${{ inputs.cache == 'true' }}
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ${{ steps.flutter-action.outputs.PUB-CACHE-PATH }}
|
||||||
|
key: ${{ steps.flutter-action.outputs.PUB-CACHE-KEY }}-${{ hashFiles('**/pubspec.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ steps.flutter-action.outputs.PUB-CACHE-KEY }}-${{ hashFiles('**/pubspec.lock') }}
|
||||||
|
${{ steps.flutter-action.outputs.PUB-CACHE-KEY }}
|
||||||
- run: $GITHUB_ACTION_PATH/setup.sh -c '${{ steps.flutter-action.outputs.CACHE-PATH }}' -n '${{ steps.flutter-action.outputs.VERSION }}' -a '${{ steps.flutter-action.outputs.ARCHITECTURE }}' ${{ steps.flutter-action.outputs.CHANNEL }}
|
- run: $GITHUB_ACTION_PATH/setup.sh -c '${{ steps.flutter-action.outputs.CACHE-PATH }}' -n '${{ steps.flutter-action.outputs.VERSION }}' -a '${{ steps.flutter-action.outputs.ARCHITECTURE }}' ${{ steps.flutter-action.outputs.CHANNEL }}
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
25
setup.sh
25
setup.sh
@@ -10,6 +10,7 @@ if ! check_command jq; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
OS_NAME=$(echo "$RUNNER_OS" | awk '{print tolower($0)}')
|
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="https://storage.googleapis.com/flutter_infra_release/releases"
|
||||||
MANIFEST_JSON_PATH="releases_$OS_NAME.json"
|
MANIFEST_JSON_PATH="releases_$OS_NAME.json"
|
||||||
MANIFEST_URL="$MANIFEST_BASE_URL/$MANIFEST_JSON_PATH"
|
MANIFEST_URL="$MANIFEST_BASE_URL/$MANIFEST_JSON_PATH"
|
||||||
@@ -66,15 +67,17 @@ download_archive() {
|
|||||||
|
|
||||||
CACHE_PATH=""
|
CACHE_PATH=""
|
||||||
CACHE_KEY=""
|
CACHE_KEY=""
|
||||||
|
PUB_CACHE_KEY=""
|
||||||
PRINT_ONLY=""
|
PRINT_ONLY=""
|
||||||
TEST_MODE=false
|
TEST_MODE=false
|
||||||
ARCH=""
|
ARCH=""
|
||||||
VERSION=""
|
VERSION=""
|
||||||
|
|
||||||
while getopts 'tc:k:pa:n:' flag; do
|
while getopts 'tc:k:d:pa:n:' flag; do
|
||||||
case "$flag" in
|
case "$flag" in
|
||||||
c) CACHE_PATH="$OPTARG" ;;
|
c) CACHE_PATH="$OPTARG" ;;
|
||||||
k) CACHE_KEY="$OPTARG" ;;
|
k) CACHE_KEY="$OPTARG" ;;
|
||||||
|
d) PUB_CACHE_KEY="$OPTARG" ;;
|
||||||
p) PRINT_ONLY=true ;;
|
p) PRINT_ONLY=true ;;
|
||||||
t) TEST_MODE=true ;;
|
t) TEST_MODE=true ;;
|
||||||
a) ARCH="$(echo "$OPTARG" | awk '{print tolower($0)}')" ;;
|
a) ARCH="$(echo "$OPTARG" | awk '{print tolower($0)}')" ;;
|
||||||
@@ -83,6 +86,8 @@ while getopts 'tc:k:pa:n:' flag; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
[[ -z $ARCH ]] && ARCH="$ARCH_NAME"
|
||||||
|
|
||||||
ARR_CHANNEL=("${@:$OPTIND:1}")
|
ARR_CHANNEL=("${@:$OPTIND:1}")
|
||||||
CHANNEL="${ARR_CHANNEL[0]}"
|
CHANNEL="${ARR_CHANNEL[0]}"
|
||||||
|
|
||||||
@@ -91,6 +96,9 @@ CHANNEL="${ARR_CHANNEL[0]}"
|
|||||||
[[ -z $ARCH ]] && ARCH=x64
|
[[ -z $ARCH ]] && ARCH=x64
|
||||||
[[ -z $CACHE_PATH ]] && CACHE_PATH="$RUNNER_TEMP/flutter/:channel:-:version:-:arch:"
|
[[ -z $CACHE_PATH ]] && CACHE_PATH="$RUNNER_TEMP/flutter/:channel:-:version:-:arch:"
|
||||||
[[ -z $CACHE_KEY ]] && CACHE_KEY="flutter-:os:-:channel:-:version:-:arch:-:hash:"
|
[[ -z $CACHE_KEY ]] && CACHE_KEY="flutter-:os:-:channel:-:version:-:arch:-:hash:"
|
||||||
|
[[ -z $PUB_CACHE_KEY ]] && PUB_CACHE_KEY="flutter-pub-:os:-:channel:-:version:-:arch:-:hash:"
|
||||||
|
# Here we specifically use `PUB_CACHE` (and not `PUB_CACHE_PATH`), because `PUB_CACHE` is what dart (and flutter) looks for in the environment
|
||||||
|
[[ -z $PUB_CACHE ]] && PUB_CACHE="$HOME/.pub-cache"
|
||||||
|
|
||||||
if [[ "$TEST_MODE" == true ]]; then
|
if [[ "$TEST_MODE" == true ]]; then
|
||||||
RELEASE_MANIFEST=$(cat "$(dirname -- "${BASH_SOURCE[0]}")/test/$MANIFEST_JSON_PATH")
|
RELEASE_MANIFEST=$(cat "$(dirname -- "${BASH_SOURCE[0]}")/test/$MANIFEST_JSON_PATH")
|
||||||
@@ -98,7 +106,7 @@ else
|
|||||||
RELEASE_MANIFEST=$(curl --silent --connect-timeout 15 --retry 5 "$MANIFEST_URL")
|
RELEASE_MANIFEST=$(curl --silent --connect-timeout 15 --retry 5 "$MANIFEST_URL")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$CHANNEL" == "master" ]]; then
|
if [[ "$CHANNEL" == "master" || "$CHANNEL" == "main" ]]; then
|
||||||
VERSION_MANIFEST="{\"channel\":\"$CHANNEL\",\"version\":\"$VERSION\",\"dart_sdk_arch\":\"$ARCH\",\"hash\":\"$CHANNEL\",\"sha256\":\"$CHANNEL\"}"
|
VERSION_MANIFEST="{\"channel\":\"$CHANNEL\",\"version\":\"$VERSION\",\"dart_sdk_arch\":\"$ARCH\",\"hash\":\"$CHANNEL\",\"sha256\":\"$CHANNEL\"}"
|
||||||
else
|
else
|
||||||
VERSION_MANIFEST=$(echo "$RELEASE_MANIFEST" | filter_by_channel "$CHANNEL" | filter_by_arch "$ARCH" | filter_by_version "$VERSION")
|
VERSION_MANIFEST=$(echo "$RELEASE_MANIFEST" | filter_by_channel "$CHANNEL" | filter_by_arch "$ARCH" | filter_by_version "$VERSION")
|
||||||
@@ -127,6 +135,7 @@ expand_key() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CACHE_KEY=$(expand_key "$CACHE_KEY")
|
CACHE_KEY=$(expand_key "$CACHE_KEY")
|
||||||
|
PUB_CACHE_KEY=$(expand_key "$PUB_CACHE_KEY")
|
||||||
CACHE_PATH=$(expand_key "$(transform_path "$CACHE_PATH")")
|
CACHE_PATH=$(expand_key "$(transform_path "$CACHE_PATH")")
|
||||||
|
|
||||||
if [[ "$PRINT_ONLY" == true ]]; then
|
if [[ "$PRINT_ONLY" == true ]]; then
|
||||||
@@ -142,6 +151,8 @@ if [[ "$PRINT_ONLY" == true ]]; then
|
|||||||
echo "ARCHITECTURE=$info_architecture"
|
echo "ARCHITECTURE=$info_architecture"
|
||||||
echo "CACHE-KEY=$CACHE_KEY"
|
echo "CACHE-KEY=$CACHE_KEY"
|
||||||
echo "CACHE-PATH=$CACHE_PATH"
|
echo "CACHE-PATH=$CACHE_PATH"
|
||||||
|
echo "PUB-CACHE-KEY=$PUB_CACHE_KEY"
|
||||||
|
echo "PUB-CACHE-PATH=$PUB_CACHE"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -151,14 +162,16 @@ if [[ "$PRINT_ONLY" == true ]]; then
|
|||||||
echo "ARCHITECTURE=$info_architecture"
|
echo "ARCHITECTURE=$info_architecture"
|
||||||
echo "CACHE-KEY=$CACHE_KEY"
|
echo "CACHE-KEY=$CACHE_KEY"
|
||||||
echo "CACHE-PATH=$CACHE_PATH"
|
echo "CACHE-PATH=$CACHE_PATH"
|
||||||
|
echo "PUB-CACHE-KEY=$PUB_CACHE_KEY"
|
||||||
|
echo "PUB-CACHE-PATH=$PUB_CACHE"
|
||||||
} >>"$GITHUB_OUTPUT"
|
} >>"$GITHUB_OUTPUT"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -x "$CACHE_PATH/bin/flutter" ]]; then
|
if [[ ! -x "$CACHE_PATH/bin/flutter" ]]; then
|
||||||
if [[ "$CHANNEL" == "master" ]]; then
|
if [[ "$CHANNEL" == "master" || "$CHANNEL" == "main" ]]; then
|
||||||
git clone -b master https://github.com/flutter/flutter.git "$CACHE_PATH"
|
git clone -b "$CHANNEL" https://github.com/flutter/flutter.git "$CACHE_PATH"
|
||||||
if [[ "$VERSION" != "any" ]]; then
|
if [[ "$VERSION" != "any" ]]; then
|
||||||
git config --global --add safe.directory "$CACHE_PATH"
|
git config --global --add safe.directory "$CACHE_PATH"
|
||||||
(cd "$CACHE_PATH" && git checkout "$VERSION")
|
(cd "$CACHE_PATH" && git checkout "$VERSION")
|
||||||
@@ -171,11 +184,11 @@ fi
|
|||||||
|
|
||||||
{
|
{
|
||||||
echo "FLUTTER_ROOT=$CACHE_PATH"
|
echo "FLUTTER_ROOT=$CACHE_PATH"
|
||||||
echo "PUB_CACHE=$CACHE_PATH/.pub-cache"
|
echo "PUB_CACHE=$PUB_CACHE"
|
||||||
} >>"$GITHUB_ENV"
|
} >>"$GITHUB_ENV"
|
||||||
|
|
||||||
{
|
{
|
||||||
echo "$CACHE_PATH/bin"
|
echo "$CACHE_PATH/bin"
|
||||||
echo "$CACHE_PATH/bin/cache/dart-sdk/bin"
|
echo "$CACHE_PATH/bin/cache/dart-sdk/bin"
|
||||||
echo "$CACHE_PATH/.pub-cache/bin"
|
echo "$PUB_CACHE/bin"
|
||||||
} >>"$GITHUB_PATH"
|
} >>"$GITHUB_PATH"
|
||||||
|
|||||||
Reference in New Issue
Block a user