25 lines
1.3 KiB
YAML
25 lines
1.3 KiB
YAML
name: build
|
|
on:
|
|
push:
|
|
branches: ['**']
|
|
tags: ['v*']
|
|
jobs:
|
|
windows:
|
|
uses: self:KofTwentyTwo/ci-workflows/.gitea/workflows/windows.yaml@v1
|
|
secrets: inherit
|
|
with:
|
|
commands: |
|
|
dotnet restore AppKit.slnx -p:Platform=x64 --locked-mode
|
|
dotnet build AppKit.slnx -p:Platform=x64 -warnaserror --no-restore
|
|
# The WinUI sample is built directly so the format workspace can load its generated XAML code.
|
|
dotnet build samples/AppKit.Sample.WinUI/AppKit.Sample.WinUI.csproj -p:Platform=x64 -warnaserror --no-restore
|
|
$env:Platform = 'x64'
|
|
dotnet format AppKit.slnx --verify-no-changes --severity warn --no-restore
|
|
Remove-Item Env:Platform
|
|
dotnet test tests/KofTwentyTwo.AppKit.Tests --no-build --settings coverage.runsettings --collect:"XPlat Code Coverage" --logger trx --results-directory TestResults
|
|
pwsh -NoProfile -File ./build/Assert-Coverage.ps1 -ResultsDirectory TestResults -Packages KofTwentyTwo.AppKit,KofTwentyTwo.AppKit.Updates
|
|
# A vX.Y.Z tag packs that version; other pushes pack the 0.1.0-dev default.
|
|
$version = if ($env:GITHUB_REF_TYPE -eq 'tag') { @("-p:Version=$($env:GITHUB_REF_NAME.TrimStart('v'))") } else { @() }
|
|
dotnet pack AppKit.slnx -c Release -p:Platform=x64 -o artifacts/nuget @version
|
|
artifacts: artifacts/nuget/*.nupkg
|