From d506555741f46e2eae2d7eae62a309a11fe121f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BC=9A=E5=81=9A=E9=A5=AD=E7=9A=84=E4=BA=8C=E5=93=88?= Date: Tue, 18 Mar 2025 16:37:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9E=84=E5=BB=BA.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dart.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/dart.yml diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml new file mode 100644 index 0000000..ab75a6e --- /dev/null +++ b/.github/workflows/dart.yml @@ -0,0 +1,36 @@ +name: Dart and Flutter Build + +on: + workflow_dispatch: # 手动触发 + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + # 安装 Dart + - uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603 + + # 安装 Flutter + - name: Install Flutter + run: | + git clone https://github.com/flutter/flutter.git -b stable + echo "$(pwd)/flutter/bin" >> $GITHUB_PATH + + # 安装 Dart 依赖 + - name: Install Dart dependencies + run: dart pub get + + # 分析项目源代码 + - name: Analyze project source + run: dart analyze + + # 运行测试 + - name: Run tests + run: dart test + + # 编译 Flutter Windows 应用 + - name: Build Flutter Windows Release + run: flutter build windows --release