Update dart.yml #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Flutter Windows Release | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.x' # 根据需要指定 Flutter 版本 | |
- name: Enable Windows Desktop Support | |
run: flutter config --enable-windows-desktop | |
- name: Add Windows Platform Support | |
run: flutter create --platforms=windows . | |
- name: Install dependencies | |
run: flutter pub get | |
# 如果项目中有测试用例,可以启用这一步 | |
- name: Run tests | |
run: flutter test | |
- name: Build Windows Release | |
run: flutter build windows --release | |
- name: Upload Release Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows-release | |
path: build/windows/runner/Release/ |