mirror of
https://github.com/EasyTier/astral.git
synced 2025-05-19 10:30:24 +00:00
40 lines
1.2 KiB
YAML
40 lines
1.2 KiB
YAML
name: Dart and Flutter Build
|
|
|
|
on:
|
|
workflow_dispatch: # 手动触发
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: windows-latest # 使用 Windows 主机
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# 安装 Flutter
|
|
- name: Install Flutter
|
|
run: |
|
|
git clone https://github.com/flutter/flutter.git -b stable
|
|
echo "$env:GITHUB_WORKSPACE\flutter\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
|
|
|
# 安装 Flutter 依赖
|
|
- name: Install Flutter dependencies
|
|
run: flutter pub get
|
|
|
|
# 编译 Flutter Windows 应用
|
|
- name: Build Flutter Windows Release
|
|
run: flutter build windows --release
|
|
|
|
# 压缩 build\windows\x64\runner\Release 目录
|
|
- name: Compress Release Directory
|
|
run: |
|
|
$releaseDir = "$env:GITHUB_WORKSPACE\build\windows\x64\runner\Release"
|
|
$zipFile = "$env:GITHUB_WORKSPACE\release.zip"
|
|
Compress-Archive -Path $releaseDir -DestinationPath $zipFile
|
|
|
|
# 上传压缩包作为 Artifact
|
|
- name: Upload Release Artifact
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: release
|
|
path: ${{ github.workspace }}/release.zip
|