forked from hesabix/arc
62 lines
1.7 KiB
YAML
62 lines
1.7 KiB
YAML
name: Flutter Windows
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- ".forgejo/workflows/flutter-windows.yml"
|
|
- "hesabixUI/hesabix_ui/**"
|
|
push:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- ".forgejo/workflows/flutter-windows.yml"
|
|
- "hesabixUI/hesabix_ui/**"
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: flutter-windows-${{ forgejo.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
verify-windows:
|
|
# The Forgejo repository must have an online Windows runner with this label.
|
|
runs-on: windows-latest
|
|
timeout-minutes: 45
|
|
defaults:
|
|
run:
|
|
working-directory: hesabixUI/hesabix_ui
|
|
shell: pwsh
|
|
steps:
|
|
- name: Check out source
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Flutter
|
|
uses: subosito/flutter-action@v2.23.0
|
|
with:
|
|
channel: stable
|
|
flutter-version: 3.47.2
|
|
|
|
- name: Resolve locked dependencies
|
|
run: flutter pub get
|
|
|
|
- name: Apply verified flutter_sound Windows patch
|
|
run: ./scripts/patch_flutter_sound_windows.ps1 -ProjectRoot $PWD.Path
|
|
|
|
- name: Analyze Dart sources
|
|
run: flutter analyze
|
|
|
|
- name: Run Flutter tests
|
|
run: flutter test
|
|
|
|
- name: Build Windows release bundle
|
|
run: flutter build windows --release --dart-define=API_BASE_URL=https://hsxn.hesabix.ir
|
|
|
|
- name: Verify Windows bundle
|
|
run: |
|
|
$bundle = "build/windows/x64/runner/Release"
|
|
if (-not (Test-Path -LiteralPath $bundle -PathType Container)) {
|
|
throw "Windows release bundle was not produced at $bundle"
|
|
}
|
|
if (-not (Get-ChildItem -LiteralPath $bundle -Filter "*.exe" -File)) {
|
|
throw "Windows release bundle does not contain an executable"
|
|
}
|