From 48cafc24713cca54bbe03cdc3a423187d413aafa Mon Sep 17 00:00:00 2001 From: Alif Rachmawadi Date: Thu, 23 Mar 2023 05:52:25 +0700 Subject: [PATCH] re-add master channel support --- .github/workflows/workflow.yml | 10 +++++++++- README.md | 2 +- setup.sh | 14 +++++++++++--- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 5f5a87d..ab3cece 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -19,7 +19,7 @@ jobs: strategy: matrix: operating-system: [ubuntu-latest, windows-latest, macos-latest] - channel: [stable, beta] + channel: [stable, beta, master] steps: - uses: actions/checkout@v3 - id: flutter-action @@ -105,6 +105,10 @@ jobs: shell: bash - run: ./setup.sh -t -p beta | grep 'flutter-macos-beta-3.9.0-0.1.pre-x64-f732038a8cf4562ce38a1d7debb30209ae3da896' shell: bash + - run: ./setup.sh -t -p dev | grep 'flutter-macos-dev-2.11.0-0.1.pre-x64-b101bfe32f634566e7cb2791a9efe19cf8828b15' + shell: bash + - run: ./setup.sh -t -p master | grep 'flutter-macos-master-master-x64-master' + shell: bash - run: ./setup.sh -t -p -n 2 any | grep 'flutter-macos-beta-2.13.0-0.4.pre-x64-25caf1461b8f643092a9f6f5b224453b5c057d10' shell: bash - run: ./setup.sh -t -p -n 1 any | grep 'flutter-macos-beta-1.26.0-17.8.pre-x64-044f2cf5607a26f8818dab0f766400e85c52bdff' @@ -117,6 +121,10 @@ jobs: shell: bash - run: ./setup.sh -t -p beta | grep '/Users/runner/work/_temp/flutter/beta-3.9.0-0.1.pre-x64' shell: bash + - run: ./setup.sh -t -p dev | grep '/Users/runner/work/_temp/flutter/dev-2.11.0-0.1.pre-x64' + shell: bash + - run: ./setup.sh -t -p master | grep '/Users/runner/work/_temp/flutter/master-master-x64' + shell: bash - run: ./setup.sh -t -p -k 'custom-:channel:-:version:-:hash:' | grep 'custom-stable-3.7.7-2ad6cd72c040113b47ee9055e722606a490ef0da' shell: bash - run: ./setup.sh -t -p -k 'custom-:channel:-:version:-:sha256:' | grep 'custom-stable-3.7.7-78957b52f023a0d811add27eddc59b1a59d27d2ada5df123f39d0315708fb2d5' diff --git a/README.md b/README.md index 9779b1f..c678284 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ steps: - uses: actions/checkout@v3 - uses: subosito/flutter-action@v2 with: - channel: 'stable' # or: 'beta' or 'dev' + channel: 'stable' # or: 'beta', 'dev' or 'master' - run: flutter --version ``` diff --git a/setup.sh b/setup.sh index 65f979a..d28192f 100755 --- a/setup.sh +++ b/setup.sh @@ -96,7 +96,11 @@ else RELEASE_MANIFEST=$(curl --silent --connect-timeout 15 --retry 5 "$MANIFEST_URL") fi -VERSION_MANIFEST=$(echo "$RELEASE_MANIFEST" | filter_by_channel "$CHANNEL" | filter_by_arch "$ARCH" | filter_by_version "$VERSION") +if [[ "$CHANNEL" == "master" ]]; then + VERSION_MANIFEST="{\"channel\":\"$CHANNEL\",\"version\":\"$CHANNEL\",\"dart_sdk_arch\":\"$ARCH\",\"hash\":\"$CHANNEL\",\"sha256\":\"$CHANNEL\"}" +else + VERSION_MANIFEST=$(echo "$RELEASE_MANIFEST" | filter_by_channel "$CHANNEL" | filter_by_arch "$ARCH" | filter_by_version "$VERSION") +fi if [[ "$VERSION_MANIFEST" == *null* ]]; then not_found_error "$CHANNEL" "$VERSION" "$ARCH" @@ -151,8 +155,12 @@ if [[ "$PRINT_ONLY" == true ]]; then fi if [[ ! -x "$CACHE_PATH/bin/flutter" ]]; then - archive_url=$(echo "$VERSION_MANIFEST" | jq -r '.archive') - download_archive "$archive_url" "$CACHE_PATH" + if [[ "$CHANNEL" == "master" ]]; then + git clone -b master https://github.com/flutter/flutter.git "$CACHE_PATH" + else + archive_url=$(echo "$VERSION_MANIFEST" | jq -r '.archive') + download_archive "$archive_url" "$CACHE_PATH" + fi fi {