name: Build for Windows x64 on: workflow_call: inputs: tag: description: "tag" required: false default: "" type: string workflow_dispatch: jobs: build-windows-app: name: Release Windows x64 runs-on: windows-latest steps: - name: Checkout code uses: actions/checkout@v6 with: fetch-depth: 0 - name: Setup flutter uses: subosito/flutter-action@v2 with: channel: stable flutter-version-file: pubspec.yaml - name: pick tooltip fix working-directory: ${{ env.FLUTTER_ROOT }} run: | git config --global user.name "ci" git config --global user.email "example@example.com" git stash || true git cherry-pick 56956c33ef102ac0b5fc46b62bd2dd9f50a86616 --no-edit git reset --soft HEAD~1 git stash pop || true continue-on-error: true - name: apply modal barrier patch working-directory: ${{ env.FLUTTER_ROOT }} run: git apply $env:GITHUB_WORKSPACE\lib\scripts\modal_barrier_patch.diff || true shell: pwsh continue-on-error: true - name: apply mouse cursor patch working-directory: ${{ env.FLUTTER_ROOT }} run: git apply $env:GITHUB_WORKSPACE\lib\scripts\mouse_cursor_patch.diff || true shell: pwsh continue-on-error: true - name: Add fastforge and Inno Setup run: | dart pub global activate fastforge choco install innosetup - name: Add Chinese language file for Inno Setup run: | Copy-Item "windows/packaging/exe/ChineseSimplified.isl" "C:\Program Files (x86)\Inno Setup 6\Languages\ChineseSimplified.isl" shell: pwsh - name: Set and Extract version shell: pwsh run: lib/scripts/build.ps1 - name: Build Windows run: | fastforge package --platform windows --targets exe --flutter-build-args="dart-define-from-file=pili_release.json" - name: Prepare Upload run: | mkdir -p Release/PiliPlus-Win mkdir -p PiliPlus-Win-Setup mv build/windows/x64/runner/Release/* Release/PiliPlus-Win/ mv dist/**/*.exe PiliPlus-Win-Setup/PiliPlus_windows_${{env.version}}_x64_setup.exe - name: Compress if: ${{ github.event.inputs.tag != '' }} run: | Compress-Archive -Path "Release/PiliPlus-Win" -DestinationPath "PiliPlus_windows_${{env.version}}_x64_portable.zip" shell: pwsh - name: Release if: ${{ github.event.inputs.tag != '' }} uses: softprops/action-gh-release@v2 with: tag_name: ${{ github.event.inputs.tag }} name: ${{ github.event.inputs.tag }} files: | PiliPlus_windows_*.zip PiliPlus-Win-Setup/PiliPlus_windows_*.exe - name: Upload windows file release uses: actions/upload-artifact@v7 with: archive: true name: PiliPlus_windows_${{env.version}}_x64_portable path: Release - name: Upload windows setup release uses: actions/upload-artifact@v7 with: archive: false name: Windows-setup-x64-release path: PiliPlus-Win-Setup/PiliPlus_windows_*.exe