From 15031825d9bc93766f77bae002ac1ab2a728eaa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Mon, 10 Nov 2025 14:45:27 +0800 Subject: [PATCH 1/3] feat: setup flutter --- setup-flutter/action.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 setup-flutter/action.yml diff --git a/setup-flutter/action.yml b/setup-flutter/action.yml new file mode 100644 index 0000000..fcadd19 --- /dev/null +++ b/setup-flutter/action.yml @@ -0,0 +1,33 @@ +name: Setup Flutter +description: Setup Flutter environment + +inputs: + flutter-version: + description: The Flutter version to use + required: true + default: stable + channel: + description: The Flutter channel to use + required: false + default: stable + cache: + description: Enable caching for Flutter SDK and packages + required: false + default: true + +runs: + using: composite + steps: + - name: Checkout + uses: actions/checkout@v5 + + - name: Setup Flutter + uses: subosito/flutter-action@v2.21.0 + with: + flutter-version: ${{ inputs.flutter-version }} + channel: ${{ inputs.channel }} + cache: ${{ inputs.cache }} + + - name: AOP Registry + run: | + flutter --version From e5a7b027a7f164f0edaa999e4391b0a8ce7eef2f Mon Sep 17 00:00:00 2001 From: liweijie0812 <674416404@qq.com> Date: Mon, 10 Nov 2025 18:23:59 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20action.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup-flutter/action.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/setup-flutter/action.yml b/setup-flutter/action.yml index fcadd19..76b8376 100644 --- a/setup-flutter/action.yml +++ b/setup-flutter/action.yml @@ -18,9 +18,6 @@ inputs: runs: using: composite steps: - - name: Checkout - uses: actions/checkout@v5 - - name: Setup Flutter uses: subosito/flutter-action@v2.21.0 with: From ca8d838d6b69322696bc2fe8200acecb962888a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Tue, 11 Nov 2025 10:23:52 +0800 Subject: [PATCH 3/3] feat: AOP Registry --- setup-flutter/action.yml | 41 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/setup-flutter/action.yml b/setup-flutter/action.yml index 76b8376..171d774 100644 --- a/setup-flutter/action.yml +++ b/setup-flutter/action.yml @@ -5,7 +5,7 @@ inputs: flutter-version: description: The Flutter version to use required: true - default: stable + default: 3.x channel: description: The Flutter channel to use required: false @@ -14,6 +14,10 @@ inputs: description: Enable caching for Flutter SDK and packages required: false default: true + apo-registry: + description: Use AOP registry for Flutter packages + required: false + default: false runs: using: composite @@ -26,5 +30,38 @@ runs: cache: ${{ inputs.cache }} - name: AOP Registry + if: ${{ inputs.apo-registry }} run: | - flutter --version + repo_url="https://raw.githubusercontent.com/TDesignOteam/tdesign-flutter-aop-registry/refs/heads/main/patch_flutter/" + flutter_version=$(flutter --version | head -n 1 | awk '{print $2}') + major_version=$(echo $flutter_version | cut -d. -f1) + minor_version=$(echo $flutter_version | cut -d. -f2) + # 2.2~3.10.patch, 3.13~3.16.patch, 3.19~3.22.patch, 3.24~3.32.patch, 3.35~infinity.patch + patch_file="" + if [ "$major_version" -gt 3 ]; then + patch_file="3.35~infinity.patch" + elif [ "$major_version" -eq 3 ]; then + if [ "$minor_version" -ge 35 ]; then + patch_file="3.35~infinity.patch" + elif [ "$minor_version" -ge 24 ] && [ "$minor_version" -le 32 ]; then + patch_file="3.24~3.32.patch" + elif [ "$minor_version" -ge 19 ] && [ "$minor_version" -le 22 ]; then + patch_file="3.19~3.22.patch" + elif [ "$minor_version" -ge 13 ] && [ "$minor_version" -le 16 ]; then + patch_file="3.13~3.16.patch" + elif [ "$minor_version" -ge 0 ] && [ "$minor_version" -le 10 ]; then + patch_file="2.2~3.10.patch" + fi + elif [ "$major_version" -eq 2 ]; then + if [ "$minor_version" -ge 2 ]; then + patch_file="2.2~3.10.patch" + fi + fi + + if [ ! -z "$patch_file" ]; then + echo "Applying patch: $patch_file" + cd ${{ env.FLUTTER_ROOT }} + curl -L "$repo_url$patch_file" | git apply + else + echo "No matching patch file found for Flutter version: $flutter_version" + fi