From 8ecfbf0cfdf4556d5dc275197e2d2385c47ac982 Mon Sep 17 00:00:00 2001 From: arkanoider <113362043+arkanoider@users.noreply.github.com> Date: Wed, 22 Oct 2025 21:56:46 +0200 Subject: [PATCH 01/18] Add GitHub Actions workflow for Windows build --- .github/workflows/windows.yml | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 00000000..08b28f99 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,46 @@ +name: Build Flutter Windows Desktop + +on: + workflow_dispatch: # manual trigger; add push / pull_request as needed + push: + branches: [ main ] + +jobs: + windows-build: + runs-on: windows-latest # GitHub-hosted Windows runner + + steps: + # 1. Check-out source + - name: Checkout repository + uses: actions/checkout@v4 + + # 2. Install Flutter + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + flutter-version: '3.24.0' # pin version or omit for latest + + # 3. Accept Windows SDK / Build Tools licenses (optional but avoids prompts) + - name: Accept SDK licenses + run: flutter doctor --android-licenses # only if Android tools present + continue-on-error: true + + # 4. Enable Windows desktop support + - name: Enable Windows desktop + run: flutter config --enable-windows-desktop + + # 5. Install project dependencies + - name: Install dependencies + run: flutter pub get + + # 6. Build Windows release + - name: Build Windows release + run: flutter build windows --release + + # 7. Upload the executable + - name: Upload Windows build + uses: actions/upload-artifact@v4 + with: + name: windows-release + path: build/windows/x64/runner/Release/ # folder containing .exe and dlls From 816ff0f3196f64093e8aa15a332b59ae95827f7c Mon Sep 17 00:00:00 2001 From: arkanoider <113362043+arkanoider@users.noreply.github.com> Date: Wed, 22 Oct 2025 21:58:15 +0200 Subject: [PATCH 02/18] Add GitHub Actions workflow for macOS Flutter build --- .github/workflows/MacOs.yaml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/MacOs.yaml diff --git a/.github/workflows/MacOs.yaml b/.github/workflows/MacOs.yaml new file mode 100644 index 00000000..f7abb784 --- /dev/null +++ b/.github/workflows/MacOs.yaml @@ -0,0 +1,35 @@ +name: Build Flutter macOS Desktop + +on: + workflow_dispatch: + push: + branches: [ main ] + +jobs: + macos-build: + runs-on: macos-latest # ← macOS runner + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + # flutter-version: '3.24.0' # optional pin + + - name: Enable macOS desktop + run: flutter config --enable-macos-desktop + + - name: Install dependencies + run: flutter pub get + + - name: Build macOS release + run: flutter build macos --release + + - name: Upload macOS build + uses: actions/upload-artifact@v4 + with: + name: macos-release + path: build/macos/Build/Products/Release/ From 449ac51c76c4b4160dc546ba467b18e8ab0e26e7 Mon Sep 17 00:00:00 2001 From: arkanoider Date: Wed, 22 Oct 2025 23:01:45 +0200 Subject: [PATCH 03/18] fix: windows build --- .github/workflows/windows.yml | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 08b28f99..041595d0 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -19,26 +19,39 @@ jobs: uses: subosito/flutter-action@v2 with: channel: stable - flutter-version: '3.24.0' # pin version or omit for latest - - # 3. Accept Windows SDK / Build Tools licenses (optional but avoids prompts) - - name: Accept SDK licenses - run: flutter doctor --android-licenses # only if Android tools present + flutter-version: '3.32.2' # match version from main.yml + + # 3. Configure Flutter (disable analytics, accept licenses) + - name: Configure Flutter + run: | + flutter config --no-analytics + flutter config --enable-windows-desktop + + # 4. Accept SDK licenses non-interactively (if Android SDK is present) + - name: Accept licenses + run: | + "y" * 100 | flutter doctor --android-licenses + shell: pwsh continue-on-error: true - # 4. Enable Windows desktop support - - name: Enable Windows desktop - run: flutter config --enable-windows-desktop - # 5. Install project dependencies - name: Install dependencies run: flutter pub get - # 6. Build Windows release + # 6. Generate localization and other required files + - name: Generate required files + run: dart run build_runner build -d + + # 7. Analyze code (optional but recommended) + - name: Analyze code + run: flutter analyze + continue-on-error: true # don't fail build on warnings + + # 8. Build Windows release - name: Build Windows release run: flutter build windows --release - # 7. Upload the executable + # 9. Upload the executable - name: Upload Windows build uses: actions/upload-artifact@v4 with: From 3d3073d16fe75c45b807c3b03b06c06e1b5ee057 Mon Sep 17 00:00:00 2001 From: arkanoider Date: Thu, 23 Oct 2025 11:48:59 +0200 Subject: [PATCH 04/18] fix: windows build --- .github/workflows/windows.yml | 41 ++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 041595d0..625dbbb6 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -42,18 +42,49 @@ jobs: - name: Generate required files run: dart run build_runner build -d - # 7. Analyze code (optional but recommended) + # 7. Extract version from pubspec.yaml + - name: Extract version + id: extract_version + run: | + $version = (Select-String -Path pubspec.yaml -Pattern '^version: ').Line -replace 'version: ','' + $version = $version.Trim() + echo "VERSION=$version" >> $env:GITHUB_ENV + echo "version=$version" >> $env:GITHUB_OUTPUT + echo "Version: $version" + shell: pwsh + + # 8. Analyze code (optional but recommended) - name: Analyze code run: flutter analyze continue-on-error: true # don't fail build on warnings - # 8. Build Windows release + # 9. Build Windows release - name: Build Windows release run: flutter build windows --release - # 9. Upload the executable - - name: Upload Windows build + # 10. Create zip package for distribution + - name: Package Windows build + run: | + $version = "${{ steps.extract_version.outputs.version }}" + cd build/windows/x64/runner/Release + Compress-Archive -Path * -DestinationPath "../../../../../mostro_mobile-$version-windows-x64.zip" + cd ../../../../../ + echo "Created: mostro_mobile-$version-windows-x64.zip" + shell: pwsh + + # 11. Upload as artifact (backup) + - name: Upload Windows build artifact uses: actions/upload-artifact@v4 with: name: windows-release - path: build/windows/x64/runner/Release/ # folder containing .exe and dlls + path: mostro_mobile-${{ steps.extract_version.outputs.version }}-windows-x64.zip + + # 12. Create GitHub Release and upload + - name: Create GitHub Release + uses: ncipollo/release-action@v1 + with: + artifacts: "mostro_mobile-${{ steps.extract_version.outputs.version }}-windows-x64.zip" + tag: v${{ steps.extract_version.outputs.version }} + allowUpdates: true + omitBodyDuringUpdate: true + replacesArtifacts: true From c7439236fe215af3a631db8a44c982d75b65a632 Mon Sep 17 00:00:00 2001 From: arkanoider Date: Thu, 23 Oct 2025 11:50:54 +0200 Subject: [PATCH 05/18] fix: macOs build --- .github/workflows/MacOs.yaml | 58 +++++++++++++++++++++++++++++++----- 1 file changed, 51 insertions(+), 7 deletions(-) diff --git a/.github/workflows/MacOs.yaml b/.github/workflows/MacOs.yaml index f7abb784..228eddf2 100644 --- a/.github/workflows/MacOs.yaml +++ b/.github/workflows/MacOs.yaml @@ -1,35 +1,79 @@ name: Build Flutter macOS Desktop on: - workflow_dispatch: + workflow_dispatch: # manual trigger push: branches: [ main ] jobs: macos-build: - runs-on: macos-latest # ← macOS runner + runs-on: macos-latest steps: + # 1. Check-out source - name: Checkout repository uses: actions/checkout@v4 + # 2. Install Flutter - name: Setup Flutter uses: subosito/flutter-action@v2 with: channel: stable - # flutter-version: '3.24.0' # optional pin + flutter-version: '3.32.2' # match version from main.yml - - name: Enable macOS desktop - run: flutter config --enable-macos-desktop + # 3. Configure Flutter (disable analytics) + - name: Configure Flutter + run: | + flutter config --no-analytics + flutter config --enable-macos-desktop + # 4. Install project dependencies - name: Install dependencies run: flutter pub get + # 5. Generate localization and other required files + - name: Generate required files + run: dart run build_runner build -d + + # 6. Extract version from pubspec.yaml + - name: Extract version + id: extract_version + run: | + version=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2 | tr -d '\r') + echo "VERSION=$version" >> $GITHUB_ENV + echo "version=$version" >> $GITHUB_OUTPUT + echo "Version: $version" + + # 7. Analyze code (optional but recommended) + - name: Analyze code + run: flutter analyze + continue-on-error: true # don't fail build on warnings + + # 8. Build macOS release - name: Build macOS release run: flutter build macos --release - - name: Upload macOS build + # 9. Create zip package for distribution + - name: Package macOS build + run: | + cd build/macos/Build/Products/Release + zip -r ../../../../../mostro_mobile-${{ steps.extract_version.outputs.version }}-macos.zip mostro_mobile.app + cd ../../../../../ + echo "Created: mostro_mobile-${{ steps.extract_version.outputs.version }}-macos.zip" + + # 10. Upload as artifact (backup) + - name: Upload macOS build artifact uses: actions/upload-artifact@v4 with: name: macos-release - path: build/macos/Build/Products/Release/ + path: mostro_mobile-${{ steps.extract_version.outputs.version }}-macos.zip + + # 11. Create GitHub Release and upload + - name: Create GitHub Release + uses: ncipollo/release-action@v1 + with: + artifacts: "mostro_mobile-${{ steps.extract_version.outputs.version }}-macos.zip" + tag: v${{ steps.extract_version.outputs.version }} + allowUpdates: true + omitBodyDuringUpdate: true + replacesArtifacts: true From 0b8fe3e9cb1b09a506b8ec9af012bdad5d5f0b6d Mon Sep 17 00:00:00 2001 From: arkanoider Date: Thu, 23 Oct 2025 12:10:05 +0200 Subject: [PATCH 06/18] fix: macOs build --- .github/workflows/{MacOs.yaml => MacOs.yml} | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) rename .github/workflows/{MacOs.yaml => MacOs.yml} (93%) diff --git a/.github/workflows/MacOs.yaml b/.github/workflows/MacOs.yml similarity index 93% rename from .github/workflows/MacOs.yaml rename to .github/workflows/MacOs.yml index 228eddf2..61ed5eed 100644 --- a/.github/workflows/MacOs.yaml +++ b/.github/workflows/MacOs.yml @@ -57,7 +57,10 @@ jobs: - name: Package macOS build run: | cd build/macos/Build/Products/Release - zip -r ../../../../../mostro_mobile-${{ steps.extract_version.outputs.version }}-macos.zip mostro_mobile.app + echo "Contents of Release directory:" + ls -la + # Zip all .app bundles (typically there's only one) + zip -r ../../../../../mostro_mobile-${{ steps.extract_version.outputs.version }}-macos.zip *.app cd ../../../../../ echo "Created: mostro_mobile-${{ steps.extract_version.outputs.version }}-macos.zip" From 7ffa57bca334700f87f96bea2a1007445576b512 Mon Sep 17 00:00:00 2001 From: arkanoider Date: Thu, 23 Oct 2025 12:21:34 +0200 Subject: [PATCH 07/18] feat: added manual trigger for actions and just on tag --- .github/workflows/MacOs.yml | 4 ++-- .github/workflows/windows.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/MacOs.yml b/.github/workflows/MacOs.yml index 61ed5eed..03eb1b07 100644 --- a/.github/workflows/MacOs.yml +++ b/.github/workflows/MacOs.yml @@ -1,9 +1,9 @@ name: Build Flutter macOS Desktop on: - workflow_dispatch: # manual trigger push: - branches: [ main ] + tags: ['v*.*.*'] # run only when a tag like v1.2.3 is pushed + workflow_dispatch: jobs: macos-build: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 625dbbb6..ebac5448 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,9 +1,9 @@ name: Build Flutter Windows Desktop on: - workflow_dispatch: # manual trigger; add push / pull_request as needed push: - branches: [ main ] + tags: ['v*.*.*'] # run only when a tag like v1.2.3 is pushed + workflow_dispatch: jobs: windows-build: From b119659ee71d3c341540b5cc9c7ab4433f012d4f Mon Sep 17 00:00:00 2001 From: arkanoider Date: Thu, 23 Oct 2025 15:22:19 +0200 Subject: [PATCH 08/18] feat: added also linux desktop build and release --- .github/workflows/linux.yml | 86 +++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 .github/workflows/linux.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 00000000..505a6a32 --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,86 @@ +name: Build Flutter Linux Desktop + +on: + push: + tags: ['v*.*.*'] # run only when a tag like v1.2.3 is pushed + workflow_dispatch: + +jobs: + linux-build: + runs-on: ubuntu-latest + + steps: + # 1. Check-out source + - name: Checkout repository + uses: actions/checkout@v4 + + # 2. Install Flutter + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + flutter-version: '3.32.2' # match version from main.yml + + # 3. Install Linux build dependencies + - name: Install Linux dependencies + run: | + sudo apt-get update -y + sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev + + # 4. Configure Flutter (disable analytics) + - name: Configure Flutter + run: | + flutter config --no-analytics + flutter config --enable-linux-desktop + + # 5. Install project dependencies + - name: Install dependencies + run: flutter pub get + + # 6. Generate localization and other required files + - name: Generate required files + run: dart run build_runner build -d + + # 7. Extract version from pubspec.yaml + - name: Extract version + id: extract_version + run: | + version=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2 | tr -d '\r') + echo "VERSION=$version" >> $GITHUB_ENV + echo "version=$version" >> $GITHUB_OUTPUT + echo "Version: $version" + + # 8. Analyze code (optional but recommended) + - name: Analyze code + run: flutter analyze + continue-on-error: true # don't fail build on warnings + + # 9. Build Linux release + - name: Build Linux release + run: flutter build linux --release + + # 10. Create tarball package for distribution + - name: Package Linux build + run: | + cd build/linux/x64/release/bundle + tar -czf ../../../../../mostro_mobile-${{ steps.extract_version.outputs.version }}-linux-x64.tar.gz * + cd ../../../../../ + echo "Created: mostro_mobile-${{ steps.extract_version.outputs.version }}-linux-x64.tar.gz" + + # 11. Upload as artifact (backup) + - name: Upload Linux build artifact + uses: actions/upload-artifact@v4 + with: + name: linux-release + path: mostro_mobile-${{ steps.extract_version.outputs.version }}-linux-x64.tar.gz + + # 12. Create GitHub Release and upload + - name: Create GitHub Release + uses: ncipollo/release-action@v1 + with: + artifacts: "mostro_mobile-${{ steps.extract_version.outputs.version }}-linux-x64.tar.gz" + tag: v${{ steps.extract_version.outputs.version }} + allowUpdates: true + omitBodyDuringUpdate: true + replacesArtifacts: true + From c7df7049b1b3e56847d33aa20c4aed4a45b68dad Mon Sep 17 00:00:00 2001 From: arkanoider Date: Thu, 23 Oct 2025 15:27:36 +0200 Subject: [PATCH 09/18] feat: single desktop file for all platform with matrix gh strategy --- .github/workflows/desktop.yml | 137 ++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 .github/workflows/desktop.yml diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml new file mode 100644 index 00000000..20d13f5b --- /dev/null +++ b/.github/workflows/desktop.yml @@ -0,0 +1,137 @@ +name: Build Flutter Desktop (Multi-Platform) + +on: + push: + tags: ['v*.*.*'] # run only when a tag like v1.2.3 is pushed + workflow_dispatch: + +jobs: + build-desktop: + strategy: + matrix: + include: + - os: ubuntu-latest + platform: linux + build-command: flutter build linux --release + artifact-path: build/linux/x64/release/bundle + artifact-name: linux-x64.tar.gz + package-command: tar -czf + - os: macos-latest + platform: macos + build-command: flutter build macos --release + artifact-path: build/macos/Build/Products/Release + artifact-name: macos.zip + package-command: zip -r + - os: windows-latest + platform: windows + build-command: flutter build windows --release + artifact-path: build/windows/x64/runner/Release + artifact-name: windows-x64.zip + package-command: Compress-Archive -Path * -DestinationPath + fail-fast: false # Continue other builds even if one fails + + runs-on: ${{ matrix.os }} + + steps: + # 1. Check-out source + - name: Checkout repository + uses: actions/checkout@v4 + + # 2. Install Flutter + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + flutter-version: '3.32.2' + + # 3. Install Linux dependencies (Linux only) + - name: Install Linux dependencies + if: matrix.platform == 'linux' + run: | + sudo apt-get update -y + sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev + + # 4. Configure Flutter + - name: Configure Flutter + shell: bash + run: | + flutter config --no-analytics + flutter config --enable-${{ matrix.platform }}-desktop + + # 5. Accept licenses (Windows only) + - name: Accept licenses + if: matrix.platform == 'windows' + run: | + "y" * 100 | flutter doctor --android-licenses + shell: pwsh + continue-on-error: true + + # 6. Install project dependencies + - name: Install dependencies + run: flutter pub get + + # 7. Generate localization and other required files + - name: Generate required files + run: dart run build_runner build -d + + # 8. Extract version from pubspec.yaml + - name: Extract version + id: extract_version + shell: bash + run: | + version=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2 | tr -d '\r') + echo "VERSION=$version" >> $GITHUB_ENV + echo "version=$version" >> $GITHUB_OUTPUT + echo "Version: $version" + + # 9. Analyze code (optional) + - name: Analyze code + run: flutter analyze + continue-on-error: true + + # 10. Build for platform + - name: Build ${{ matrix.platform }} release + run: ${{ matrix.build-command }} + + # 11. Package build (Linux) + - name: Package Linux build + if: matrix.platform == 'linux' + run: | + cd ${{ matrix.artifact-path }} + tar -czf ../../../../../mostro_mobile-${{ steps.extract_version.outputs.version }}-${{ matrix.artifact-name }} * + cd ../../../../../ + + # 12. Package build (macOS) + - name: Package macOS build + if: matrix.platform == 'macos' + run: | + cd ${{ matrix.artifact-path }} + zip -r ../../../../../mostro_mobile-${{ steps.extract_version.outputs.version }}-${{ matrix.artifact-name }} *.app + cd ../../../../../ + + # 13. Package build (Windows) + - name: Package Windows build + if: matrix.platform == 'windows' + shell: pwsh + run: | + cd ${{ matrix.artifact-path }} + Compress-Archive -Path * -DestinationPath "../../../../../mostro_mobile-${{ steps.extract_version.outputs.version }}-${{ matrix.artifact-name }}" + cd ../../../../../ + + # 14. Upload as artifact + - name: Upload ${{ matrix.platform }} artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.platform }}-release + path: mostro_mobile-${{ steps.extract_version.outputs.version }}-${{ matrix.artifact-name }} + + # 15. Create GitHub Release and upload + - name: Create GitHub Release + uses: ncipollo/release-action@v1 + with: + artifacts: "mostro_mobile-${{ steps.extract_version.outputs.version }}-${{ matrix.artifact-name }}" + tag: v${{ steps.extract_version.outputs.version }} + allowUpdates: true + omitBodyDuringUpdate: true + replacesArtifacts: true + From d7ce868690658bd2e5c0a021d68e7d955632387e Mon Sep 17 00:00:00 2001 From: arkanoider Date: Thu, 23 Oct 2025 15:31:13 +0200 Subject: [PATCH 10/18] chore: pinned Ubuntu version --- .github/workflows/desktop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 20d13f5b..966ec74f 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: include: - - os: ubuntu-latest + - os: ubuntu-22.04 platform: linux build-command: flutter build linux --release artifact-path: build/linux/x64/release/bundle From e4f8c5a053c287a970052654a2898129090e9b32 Mon Sep 17 00:00:00 2001 From: arkanoider Date: Thu, 23 Oct 2025 15:33:39 +0200 Subject: [PATCH 11/18] chore: missing dependency --- .github/workflows/desktop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 966ec74f..66c537c2 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -49,7 +49,7 @@ jobs: if: matrix.platform == 'linux' run: | sudo apt-get update -y - sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev + sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev libsecret-1-dev # 4. Configure Flutter - name: Configure Flutter From 37b04b203905f73ac13d5a5151fdbf955cef7d43 Mon Sep 17 00:00:00 2001 From: arkanoider Date: Thu, 23 Oct 2025 15:34:36 +0200 Subject: [PATCH 12/18] chore: removed single desktop build files --- .github/workflows/MacOs.yml | 82 ------------------------------- .github/workflows/linux.yml | 86 --------------------------------- .github/workflows/windows.yml | 90 ----------------------------------- 3 files changed, 258 deletions(-) delete mode 100644 .github/workflows/MacOs.yml delete mode 100644 .github/workflows/linux.yml delete mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/MacOs.yml b/.github/workflows/MacOs.yml deleted file mode 100644 index 03eb1b07..00000000 --- a/.github/workflows/MacOs.yml +++ /dev/null @@ -1,82 +0,0 @@ -name: Build Flutter macOS Desktop - -on: - push: - tags: ['v*.*.*'] # run only when a tag like v1.2.3 is pushed - workflow_dispatch: - -jobs: - macos-build: - runs-on: macos-latest - - steps: - # 1. Check-out source - - name: Checkout repository - uses: actions/checkout@v4 - - # 2. Install Flutter - - name: Setup Flutter - uses: subosito/flutter-action@v2 - with: - channel: stable - flutter-version: '3.32.2' # match version from main.yml - - # 3. Configure Flutter (disable analytics) - - name: Configure Flutter - run: | - flutter config --no-analytics - flutter config --enable-macos-desktop - - # 4. Install project dependencies - - name: Install dependencies - run: flutter pub get - - # 5. Generate localization and other required files - - name: Generate required files - run: dart run build_runner build -d - - # 6. Extract version from pubspec.yaml - - name: Extract version - id: extract_version - run: | - version=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2 | tr -d '\r') - echo "VERSION=$version" >> $GITHUB_ENV - echo "version=$version" >> $GITHUB_OUTPUT - echo "Version: $version" - - # 7. Analyze code (optional but recommended) - - name: Analyze code - run: flutter analyze - continue-on-error: true # don't fail build on warnings - - # 8. Build macOS release - - name: Build macOS release - run: flutter build macos --release - - # 9. Create zip package for distribution - - name: Package macOS build - run: | - cd build/macos/Build/Products/Release - echo "Contents of Release directory:" - ls -la - # Zip all .app bundles (typically there's only one) - zip -r ../../../../../mostro_mobile-${{ steps.extract_version.outputs.version }}-macos.zip *.app - cd ../../../../../ - echo "Created: mostro_mobile-${{ steps.extract_version.outputs.version }}-macos.zip" - - # 10. Upload as artifact (backup) - - name: Upload macOS build artifact - uses: actions/upload-artifact@v4 - with: - name: macos-release - path: mostro_mobile-${{ steps.extract_version.outputs.version }}-macos.zip - - # 11. Create GitHub Release and upload - - name: Create GitHub Release - uses: ncipollo/release-action@v1 - with: - artifacts: "mostro_mobile-${{ steps.extract_version.outputs.version }}-macos.zip" - tag: v${{ steps.extract_version.outputs.version }} - allowUpdates: true - omitBodyDuringUpdate: true - replacesArtifacts: true diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml deleted file mode 100644 index 505a6a32..00000000 --- a/.github/workflows/linux.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: Build Flutter Linux Desktop - -on: - push: - tags: ['v*.*.*'] # run only when a tag like v1.2.3 is pushed - workflow_dispatch: - -jobs: - linux-build: - runs-on: ubuntu-latest - - steps: - # 1. Check-out source - - name: Checkout repository - uses: actions/checkout@v4 - - # 2. Install Flutter - - name: Setup Flutter - uses: subosito/flutter-action@v2 - with: - channel: stable - flutter-version: '3.32.2' # match version from main.yml - - # 3. Install Linux build dependencies - - name: Install Linux dependencies - run: | - sudo apt-get update -y - sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev - - # 4. Configure Flutter (disable analytics) - - name: Configure Flutter - run: | - flutter config --no-analytics - flutter config --enable-linux-desktop - - # 5. Install project dependencies - - name: Install dependencies - run: flutter pub get - - # 6. Generate localization and other required files - - name: Generate required files - run: dart run build_runner build -d - - # 7. Extract version from pubspec.yaml - - name: Extract version - id: extract_version - run: | - version=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2 | tr -d '\r') - echo "VERSION=$version" >> $GITHUB_ENV - echo "version=$version" >> $GITHUB_OUTPUT - echo "Version: $version" - - # 8. Analyze code (optional but recommended) - - name: Analyze code - run: flutter analyze - continue-on-error: true # don't fail build on warnings - - # 9. Build Linux release - - name: Build Linux release - run: flutter build linux --release - - # 10. Create tarball package for distribution - - name: Package Linux build - run: | - cd build/linux/x64/release/bundle - tar -czf ../../../../../mostro_mobile-${{ steps.extract_version.outputs.version }}-linux-x64.tar.gz * - cd ../../../../../ - echo "Created: mostro_mobile-${{ steps.extract_version.outputs.version }}-linux-x64.tar.gz" - - # 11. Upload as artifact (backup) - - name: Upload Linux build artifact - uses: actions/upload-artifact@v4 - with: - name: linux-release - path: mostro_mobile-${{ steps.extract_version.outputs.version }}-linux-x64.tar.gz - - # 12. Create GitHub Release and upload - - name: Create GitHub Release - uses: ncipollo/release-action@v1 - with: - artifacts: "mostro_mobile-${{ steps.extract_version.outputs.version }}-linux-x64.tar.gz" - tag: v${{ steps.extract_version.outputs.version }} - allowUpdates: true - omitBodyDuringUpdate: true - replacesArtifacts: true - diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index ebac5448..00000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: Build Flutter Windows Desktop - -on: - push: - tags: ['v*.*.*'] # run only when a tag like v1.2.3 is pushed - workflow_dispatch: - -jobs: - windows-build: - runs-on: windows-latest # GitHub-hosted Windows runner - - steps: - # 1. Check-out source - - name: Checkout repository - uses: actions/checkout@v4 - - # 2. Install Flutter - - name: Setup Flutter - uses: subosito/flutter-action@v2 - with: - channel: stable - flutter-version: '3.32.2' # match version from main.yml - - # 3. Configure Flutter (disable analytics, accept licenses) - - name: Configure Flutter - run: | - flutter config --no-analytics - flutter config --enable-windows-desktop - - # 4. Accept SDK licenses non-interactively (if Android SDK is present) - - name: Accept licenses - run: | - "y" * 100 | flutter doctor --android-licenses - shell: pwsh - continue-on-error: true - - # 5. Install project dependencies - - name: Install dependencies - run: flutter pub get - - # 6. Generate localization and other required files - - name: Generate required files - run: dart run build_runner build -d - - # 7. Extract version from pubspec.yaml - - name: Extract version - id: extract_version - run: | - $version = (Select-String -Path pubspec.yaml -Pattern '^version: ').Line -replace 'version: ','' - $version = $version.Trim() - echo "VERSION=$version" >> $env:GITHUB_ENV - echo "version=$version" >> $env:GITHUB_OUTPUT - echo "Version: $version" - shell: pwsh - - # 8. Analyze code (optional but recommended) - - name: Analyze code - run: flutter analyze - continue-on-error: true # don't fail build on warnings - - # 9. Build Windows release - - name: Build Windows release - run: flutter build windows --release - - # 10. Create zip package for distribution - - name: Package Windows build - run: | - $version = "${{ steps.extract_version.outputs.version }}" - cd build/windows/x64/runner/Release - Compress-Archive -Path * -DestinationPath "../../../../../mostro_mobile-$version-windows-x64.zip" - cd ../../../../../ - echo "Created: mostro_mobile-$version-windows-x64.zip" - shell: pwsh - - # 11. Upload as artifact (backup) - - name: Upload Windows build artifact - uses: actions/upload-artifact@v4 - with: - name: windows-release - path: mostro_mobile-${{ steps.extract_version.outputs.version }}-windows-x64.zip - - # 12. Create GitHub Release and upload - - name: Create GitHub Release - uses: ncipollo/release-action@v1 - with: - artifacts: "mostro_mobile-${{ steps.extract_version.outputs.version }}-windows-x64.zip" - tag: v${{ steps.extract_version.outputs.version }} - allowUpdates: true - omitBodyDuringUpdate: true - replacesArtifacts: true From 3a61ddff0cd5235dfaf981a201289c70a3a48902 Mon Sep 17 00:00:00 2001 From: arkanoider Date: Thu, 23 Oct 2025 15:57:46 +0200 Subject: [PATCH 13/18] fix: license acceptance fix --- .github/workflows/desktop.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 66c537c2..df3e4ea4 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -58,14 +58,21 @@ jobs: flutter config --no-analytics flutter config --enable-${{ matrix.platform }}-desktop - # 5. Accept licenses (Windows only) - - name: Accept licenses + # 5. Accept SDK licenses non-interactively + - name: Accept licenses (Windows) if: matrix.platform == 'windows' run: | "y" * 100 | flutter doctor --android-licenses shell: pwsh continue-on-error: true + - name: Accept licenses (Linux/macOS) + if: matrix.platform != 'windows' + run: | + yes | flutter doctor --android-licenses || true + shell: bash + continue-on-error: true + # 6. Install project dependencies - name: Install dependencies run: flutter pub get From 4a6e6558d138d0123dfcfca5151eabefae776594 Mon Sep 17 00:00:00 2001 From: arkanoider Date: Thu, 23 Oct 2025 16:34:00 +0200 Subject: [PATCH 14/18] fix: license for windows acceptance --- .github/workflows/desktop.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index df3e4ea4..40233328 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -62,7 +62,8 @@ jobs: - name: Accept licenses (Windows) if: matrix.platform == 'windows' run: | - "y" * 100 | flutter doctor --android-licenses + $input = "y`n" * 100 + $input | flutter doctor --android-licenses shell: pwsh continue-on-error: true From aeed0a6c0e641c2e561671e22279db0dca407664 Mon Sep 17 00:00:00 2001 From: arkanoider Date: Thu, 23 Oct 2025 16:51:24 +0200 Subject: [PATCH 15/18] fix: license for windows acceptance --- .github/workflows/desktop.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 40233328..65978bf3 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -43,6 +43,7 @@ jobs: with: channel: stable flutter-version: '3.32.2' + cache: true # Enable caching for faster builds # 3. Install Linux dependencies (Linux only) - name: Install Linux dependencies @@ -64,6 +65,7 @@ jobs: run: | $input = "y`n" * 100 $input | flutter doctor --android-licenses + exit 0 shell: pwsh continue-on-error: true From d99b7ff65cd33e67e9f296c8cd94a5b3c0193e6c Mon Sep 17 00:00:00 2001 From: arkanoider <113362043+arkanoider@users.noreply.github.com> Date: Thu, 23 Oct 2025 17:01:54 +0200 Subject: [PATCH 16/18] chore: fix by rabbit Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .github/workflows/desktop.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 65978bf3..ced56a79 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -103,31 +103,30 @@ jobs: - name: Build ${{ matrix.platform }} release run: ${{ matrix.build-command }} - # 11. Package build (Linux) + # 11. Package Linux build - name: Package Linux build if: matrix.platform == 'linux' run: | - cd ${{ matrix.artifact-path }} - tar -czf ../../../../../mostro_mobile-${{ steps.extract_version.outputs.version }}-${{ matrix.artifact-name }} * - cd ../../../../../ + mkdir -p ./dist + tar -czf ./dist/mostro_mobile-${{ steps.extract_version.outputs.version }}-${{ matrix.artifact-name }} \ + -C ${{ matrix.artifact-path }} . # 12. Package build (macOS) - name: Package macOS build if: matrix.platform == 'macos' run: | - cd ${{ matrix.artifact-path }} - zip -r ../../../../../mostro_mobile-${{ steps.extract_version.outputs.version }}-${{ matrix.artifact-name }} *.app - cd ../../../../../ + mkdir -p ./dist + find ${{ matrix.artifact-path }} -name "*.app" -type d | head -1 | xargs -I {} \ + zip -r ./dist/mostro_mobile-${{ steps.extract_version.outputs.version }}-${{ matrix.artifact-name }} {} # 13. Package build (Windows) - name: Package Windows build if: matrix.platform == 'windows' shell: pwsh run: | - cd ${{ matrix.artifact-path }} - Compress-Archive -Path * -DestinationPath "../../../../../mostro_mobile-${{ steps.extract_version.outputs.version }}-${{ matrix.artifact-name }}" - cd ../../../../../ - + if (-not (Test-Path "./dist")) { New-Item -ItemType Directory -Path "./dist" | Out-Null } + Compress-Archive -Path "${{ matrix.artifact-path }}/*" ` + -DestinationPath "./dist/mostro_mobile-${{ steps.extract_version.outputs.version }}-${{ matrix.artifact-name }}" # 14. Upload as artifact - name: Upload ${{ matrix.platform }} artifact uses: actions/upload-artifact@v4 From 535b00e49ca52f982d4250a09b2a94a495d4f24f Mon Sep 17 00:00:00 2001 From: arkanoider <113362043+arkanoider@users.noreply.github.com> Date: Thu, 23 Oct 2025 17:10:18 +0200 Subject: [PATCH 17/18] chore: fix by rabbit Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .github/workflows/desktop.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index ced56a79..f02ff2c3 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -90,6 +90,10 @@ jobs: shell: bash run: | version=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2 | tr -d '\r') + if [[ -z "$version" ]]; then + echo "ERROR: Could not extract version from pubspec.yaml" + exit 1 + fi echo "VERSION=$version" >> $GITHUB_ENV echo "version=$version" >> $GITHUB_OUTPUT echo "Version: $version" From d8642f4e93bf566e4a1f3e2ba077ff7ef896fd99 Mon Sep 17 00:00:00 2001 From: arkanoider Date: Thu, 23 Oct 2025 17:26:20 +0200 Subject: [PATCH 18/18] fix: improved flow of desktop.yml file --- .github/workflows/desktop.yml | 69 +++++++++++++++++++++++++++-------- 1 file changed, 54 insertions(+), 15 deletions(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index f02ff2c3..e4853307 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -4,6 +4,14 @@ on: push: tags: ['v*.*.*'] # run only when a tag like v1.2.3 is pushed workflow_dispatch: + inputs: + flutter_version: + description: 'Flutter version (or "latest")' + required: false + default: '3.32.2' + +env: + FLUTTER_VERSION: '3.32.2' # Default Flutter version jobs: build-desktop: @@ -42,7 +50,7 @@ jobs: uses: subosito/flutter-action@v2 with: channel: stable - flutter-version: '3.32.2' + flutter-version: ${{ inputs.flutter_version || env.FLUTTER_VERSION }} cache: true # Enable caching for faster builds # 3. Install Linux dependencies (Linux only) @@ -76,15 +84,26 @@ jobs: shell: bash continue-on-error: true - # 6. Install project dependencies + # 6. Cache pub dependencies + - name: Cache pub dependencies + uses: actions/cache@v4 + with: + path: | + ~/.pub-cache + ${{ runner.os == 'Windows' && '%LOCALAPPDATA%\Pub\Cache' || '' }} + key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }} + restore-keys: | + ${{ runner.os }}-pub- + + # 7. Install project dependencies - name: Install dependencies run: flutter pub get - # 7. Generate localization and other required files + # 8. Generate localization and other required files - name: Generate required files run: dart run build_runner build -d - # 8. Extract version from pubspec.yaml + # 9. Extract version from pubspec.yaml - name: Extract version id: extract_version shell: bash @@ -98,16 +117,26 @@ jobs: echo "version=$version" >> $GITHUB_OUTPUT echo "Version: $version" - # 9. Analyze code (optional) + # 10. Analyze code (optional) - name: Analyze code - run: flutter analyze + run: flutter analyze --fatal-infos continue-on-error: true - # 10. Build for platform + # 11. Build for platform - name: Build ${{ matrix.platform }} release run: ${{ matrix.build-command }} + + # 12. Verify build output exists + - name: Verify build output + shell: bash + run: | + if [ ! -d "${{ matrix.artifact-path }}" ]; then + echo "ERROR: Build output not found at ${{ matrix.artifact-path }}" + exit 1 + fi + echo "✅ Build output verified at ${{ matrix.artifact-path }}" - # 11. Package Linux build + # 13. Package Linux build - name: Package Linux build if: matrix.platform == 'linux' run: | @@ -115,7 +144,7 @@ jobs: tar -czf ./dist/mostro_mobile-${{ steps.extract_version.outputs.version }}-${{ matrix.artifact-name }} \ -C ${{ matrix.artifact-path }} . - # 12. Package build (macOS) + # 14. Package build (macOS) - name: Package macOS build if: matrix.platform == 'macos' run: | @@ -123,7 +152,7 @@ jobs: find ${{ matrix.artifact-path }} -name "*.app" -type d | head -1 | xargs -I {} \ zip -r ./dist/mostro_mobile-${{ steps.extract_version.outputs.version }}-${{ matrix.artifact-name }} {} - # 13. Package build (Windows) + # 15. Package build (Windows) - name: Package Windows build if: matrix.platform == 'windows' shell: pwsh @@ -131,20 +160,30 @@ jobs: if (-not (Test-Path "./dist")) { New-Item -ItemType Directory -Path "./dist" | Out-Null } Compress-Archive -Path "${{ matrix.artifact-path }}/*" ` -DestinationPath "./dist/mostro_mobile-${{ steps.extract_version.outputs.version }}-${{ matrix.artifact-name }}" - # 14. Upload as artifact + + # 16. Upload as artifact - name: Upload ${{ matrix.platform }} artifact uses: actions/upload-artifact@v4 with: name: ${{ matrix.platform }}-release - path: mostro_mobile-${{ steps.extract_version.outputs.version }}-${{ matrix.artifact-name }} + path: ./dist/mostro_mobile-${{ steps.extract_version.outputs.version }}-${{ matrix.artifact-name }} - # 15. Create GitHub Release and upload + # 17. Create GitHub Release and upload - name: Create GitHub Release uses: ncipollo/release-action@v1 with: - artifacts: "mostro_mobile-${{ steps.extract_version.outputs.version }}-${{ matrix.artifact-name }}" + artifacts: "./dist/mostro_mobile-${{ steps.extract_version.outputs.version }}-${{ matrix.artifact-name }}" tag: v${{ steps.extract_version.outputs.version }} + name: "Release v${{ steps.extract_version.outputs.version }}" + body: | + ## Desktop Builds - v${{ steps.extract_version.outputs.version }} + + **Platform**: ${{ matrix.platform }} + **Flutter Version**: ${{ inputs.flutter_version || env.FLUTTER_VERSION }} + **Build Date**: ${{ github.event.head_commit.timestamp }} allowUpdates: true - omitBodyDuringUpdate: true + omitBodyDuringUpdate: false replacesArtifacts: true + draft: false + prerelease: false