diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..5ac62e5 --- /dev/null +++ b/.github/workflows/windows.yml @@ -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