From f93bde5657b19275be40c73fe32e4c27ef99a9f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Thu, 13 Nov 2025 17:16:58 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E7=BC=93=E5=AD=98=EF=BC=8C=E5=A4=9A=E6=AC=A1=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E8=A1=A5=E4=B8=81=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup-flutter/action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/setup-flutter/action.yml b/setup-flutter/action.yml index 9103863..239d49a 100644 --- a/setup-flutter/action.yml +++ b/setup-flutter/action.yml @@ -61,8 +61,13 @@ runs: if [ ! -z "$patch_file" ]; then echo "Applying patch: $patch_file" + git status + + git reset --hard HEAD + git status cd ${{ env.FLUTTER_ROOT }} curl -L "$patch_url$patch_file" | git apply + git status else echo "No matching patch file found for Flutter version: $flutter_version" fi From 33ac3ec57a22d2e1ad60dff9114d88d31c00a59c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Thu, 13 Nov 2025 17:36:12 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E6=B8=85=E7=90=86=E6=9C=AA?= =?UTF-8?q?=E8=B7=9F=E8=B8=AA=E7=9A=84=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup-flutter/action.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup-flutter/action.yml b/setup-flutter/action.yml index 239d49a..134f56b 100644 --- a/setup-flutter/action.yml +++ b/setup-flutter/action.yml @@ -61,13 +61,18 @@ runs: if [ ! -z "$patch_file" ]; then echo "Applying patch: $patch_file" + echo "before start status" git status - + echo "before reset" git reset --hard HEAD + git clean -fd + echo "before reset status" git status + echo "before end status" cd ${{ env.FLUTTER_ROOT }} curl -L "$patch_url$patch_file" | git apply git status + echo "after status" else echo "No matching patch file found for Flutter version: $flutter_version" fi From 391734e54e19ac92eb2c67184bc9f38c7a29620f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Thu, 13 Nov 2025 17:48:44 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E6=B8=85=E7=90=86=E6=9C=AA?= =?UTF-8?q?=E8=B7=9F=E8=B8=AA=E7=9A=84=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup-flutter/action.yml | 44 ++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/setup-flutter/action.yml b/setup-flutter/action.yml index 134f56b..33312d8 100644 --- a/setup-flutter/action.yml +++ b/setup-flutter/action.yml @@ -33,10 +33,14 @@ runs: if: ${{ inputs.aop-registry }} shell: bash run: | + set -e + patch_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 @@ -59,20 +63,30 @@ runs: fi fi - if [ ! -z "$patch_file" ]; then - echo "Applying patch: $patch_file" - echo "before start status" - git status - echo "before reset" - git reset --hard HEAD - git clean -fd - echo "before reset status" - git status - echo "before end status" - cd ${{ env.FLUTTER_ROOT }} - curl -L "$patch_url$patch_file" | git apply - git status - echo "after status" - else + if [ -z "$patch_file" ]; then echo "No matching patch file found for Flutter version: $flutter_version" + exit 0 fi + + echo "Flutter version: $flutter_version" + echo "Selected patch: $patch_file" + + # 进入 Flutter SDK 目录 + cd "${{ env.FLUTTER_ROOT }}" + + # 下载补丁 + echo "Downloading patch: $patch_url$patch_file" + patch_content=$(curl -fsSL "$patch_url$patch_file") + + # 检查补丁是否已应用 + if echo "$patch_content" | git apply --reverse --check 2>/dev/null; then + echo "Patch already applied, cleaning up old patch..." + echo "$patch_content" | git apply --reverse + echo "Old patch removed" + fi + + # 应用新补丁 + echo "Applying patch..." + echo "$patch_content" | git apply --verbose + + echo "✓ Patch applied successfully"