From 02b923c0e1a5868734f1d56fa4083c3be4f554f3 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Mon, 20 Nov 2023 01:29:45 -0800 Subject: [PATCH] add support for the `main` channel (#258) * add support for the main channel * update testing for the 'main' channel --- .github/workflows/workflow.yml | 3 +++ README.md | 2 +- setup.sh | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 0572d39..b86dc00 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -20,6 +20,9 @@ jobs: matrix: operating-system: [ubuntu-latest, windows-latest, macos-latest] channel: [stable, beta, master] + include: + - operating-system: ubuntu-latest + channel: main steps: - uses: actions/checkout@v3 - id: flutter-action diff --git a/README.md b/README.md index 15d18af..294b785 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', 'dev' or 'master' + channel: 'stable' # or: 'beta', 'dev', 'master' (or 'main') - run: flutter --version ``` diff --git a/setup.sh b/setup.sh index 64b0a5e..7066296 100755 --- a/setup.sh +++ b/setup.sh @@ -98,7 +98,7 @@ else RELEASE_MANIFEST=$(curl --silent --connect-timeout 15 --retry 5 "$MANIFEST_URL") 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\"}" else VERSION_MANIFEST=$(echo "$RELEASE_MANIFEST" | filter_by_channel "$CHANNEL" | filter_by_arch "$ARCH" | filter_by_version "$VERSION") @@ -157,8 +157,8 @@ if [[ "$PRINT_ONLY" == true ]]; then fi if [[ ! -x "$CACHE_PATH/bin/flutter" ]]; then - if [[ "$CHANNEL" == "master" ]]; then - git clone -b master https://github.com/flutter/flutter.git "$CACHE_PATH" + if [[ "$CHANNEL" == "master" || "$CHANNEL" == "main" ]]; then + git clone -b "$CHANNEL" https://github.com/flutter/flutter.git "$CACHE_PATH" if [[ "$VERSION" != "any" ]]; then git config --global --add safe.directory "$CACHE_PATH" (cd "$CACHE_PATH" && git checkout "$VERSION")