ci: GitHub Actions windows-latest 构建 jiu client(flutter build windows + 打包 artifact)
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
name: Build Windows (jiu client)
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [ main ]
|
||||
paths:
|
||||
- 'client/**'
|
||||
- '.github/workflows/windows.yml'
|
||||
|
||||
jobs:
|
||||
build-windows:
|
||||
runs-on: windows-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: client
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: stable
|
||||
|
||||
- run: flutter --version
|
||||
|
||||
- run: flutter config --enable-windows-desktop
|
||||
|
||||
- run: flutter pub get
|
||||
|
||||
- run: flutter build windows --release
|
||||
|
||||
- name: Package Release
|
||||
shell: pwsh
|
||||
run: |
|
||||
$rel = Get-ChildItem -Path build/windows -Recurse -Directory -Filter Release |
|
||||
Where-Object { $_.FullName -match 'runner' } | Select-Object -First 1
|
||||
if (-not $rel) { throw 'Release dir not found' }
|
||||
Write-Host "Release dir: $($rel.FullName)"
|
||||
Compress-Archive -Path "$($rel.FullName)/*" -DestinationPath jiu-windows-x64.zip -Force
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: jiu-windows-x64
|
||||
path: client/jiu-windows-x64.zip
|
||||
if-no-files-found: error
|
||||
Reference in New Issue
Block a user