server-monitor-manager/.github/workflows/windows-build.yml
2026-07-17 09:19:09 +07:00

53 lines
2 KiB
YAML

name: Windows build
on:
push:
branches: ['**']
pull_request:
permissions:
contents: read
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up .NET 10
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Restore
run: dotnet restore src/ServerMonitorManager.Desktop/ServerMonitorManager.Desktop.csproj -p:Platform=x64 -p:PublishReadyToRun=true -r win-x64
- name: Build x64 Release
run: dotnet build src/ServerMonitorManager.Desktop/ServerMonitorManager.Desktop.csproj --configuration Release -p:Platform=x64 -p:PublishReadyToRun=true -r win-x64 --no-restore
- name: Verify formatting
run: dotnet format src/ServerMonitorManager.Desktop/ServerMonitorManager.Desktop.csproj --verify-no-changes --no-restore
- name: Build test-signed MSIX installer
shell: pwsh
run: |
$directory = Join-Path $env:RUNNER_TEMP 'smm-test-signing'
$password = [Convert]::ToBase64String([Security.Cryptography.RandomNumberGenerator]::GetBytes(24))
./build/windows/New-TestSigningCertificate.ps1 -OutputDirectory $directory -Password $password
./build/windows/Build-Installer.ps1 `
-CertificatePath (Join-Path $directory 'server-monitor-manager-test-signing.pfx') `
-CertificatePassword $password
Copy-Item `
-LiteralPath (Join-Path $directory 'server-monitor-manager-test-signing.cer') `
-Destination artifacts/windows-installer/ServerMonitorManager-test-signing.cer
- name: Upload test installer
uses: actions/upload-artifact@v6
with:
name: ServerMonitorManager-win-x64-test
path: |
artifacts/windows-installer/ServerMonitorManager-win-x64.msix
artifacts/windows-installer/ServerMonitorManager-test-signing.cer
artifacts/windows-installer/SHA256SUMS
if-no-files-found: error