diff --git a/.github/release_message.md b/.github/release_message.md index b91cbf5..a9bb1b1 100644 --- a/.github/release_message.md +++ b/.github/release_message.md @@ -80,6 +80,12 @@ +
+ + + 10 or later diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 8619d38..88b109f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -69,12 +69,43 @@ jobs: shell: pwsh run: | $source = "build/windows/x64/runner/Release" - $zipPath = "build/windows/x64/runner/Release/DefyxVPN-Windows-Portable-x64.zip" + $zipPath = "build/windows/DefyxVPN-Windows-Portable-x64.zip" if (Test-Path $zipPath) { Remove-Item $zipPath } Compress-Archive -Path "$source\*" -DestinationPath $zipPath - - name: Upload Windows Release ZIP + - name: Build Windows Installer + shell: pwsh + run: | + $pubspecPath = "pubspec.yaml" + $pubspec = Get-Content $pubspecPath -Raw + $versionMatch = [regex]::Match($pubspec, '(?m)^version:\s*(\d+\.\d+\.\d+)\+(\d+)\s*$') + if (-not $versionMatch.Success) { + throw "Could not find a Flutter version in pubspec.yaml" + } + $msixVersion = "$($versionMatch.Groups[1].Value).$($versionMatch.Groups[2].Value)" + $pubspec = [regex]::Replace( + $pubspec, + '(?m)^ msix_version:\s*.*$', + " msix_version: $msixVersion" + ) + Set-Content -Path $pubspecPath -Value $pubspec -NoNewline + + dart run msix:create + + $installerDirectory = "build/windows/installer" + New-Item -ItemType Directory -Force -Path $installerDirectory | Out-Null + $msix = Get-ChildItem -Path "build/windows" -Filter "*.msix" -Recurse | + Where-Object { $_.FullName -notlike "*\installer\*" } | + Select-Object -First 1 + if ($null -eq $msix) { + throw "MSIX package was not generated" + } + Move-Item $msix.FullName "$installerDirectory\DefyxVPN-Windows-Installer-x64.msix" -Force + + - name: Upload Windows Release Artifacts uses: actions/upload-artifact@v4 with: name: windows-release - path: build/windows/x64/runner/Release/DefyxVPN-Windows-Portable-x64.zip + path: | + build/windows/DefyxVPN-Windows-Portable-x64.zip + build/windows/installer/DefyxVPN-Windows-Installer-x64.msix