-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (76 loc) · 3.2 KB
/
Copy pathbuild.yml
File metadata and controls
90 lines (76 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Build
on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
push:
branches:
- v*
paths-ignore:
- '.claude-plugins/**'
- 'skills/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
# Nerdbank.GitVersioning appends Git*Version lines to $GITHUB_ENV once per project. With parallel
# MSBuild (-m) the worker processes race on that file and tear lines, which the runner then rejects
# with "Invalid format '1.0.0'" at the end of the step. Nothing here consumes those variables.
env:
NBGV_SetCloudBuildVersionVars: false
permissions:
id-token: write # required for NuGet trusted publishing (OIDC)
contents: read
runs-on: macos-26
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0 # nbgv computes {height} from full history
- name: Setup .NET 10.0
uses: actions/setup-dotnet@v6
with:
dotnet-version: '10.0.x'
workloads: maui-ios, maui-android, maui-maccatalyst, macos, wasm-tools
- name: Build
run: dotnet build build.slnf /restore -m -property:Configuration=Release -property:PublicRelease=true
# No --no-build: build.slnf deliberately excludes the test project, so the previous step never
# produced its output. xunit v3 runs on Microsoft.Testing.Platform, so trx comes from
# --report-trx (the VSTest "--logger trx" spelling is silently ignored here).
# TestingPlatformShowTestsFailure surfaces the failing test name, assertion and stack as MSBuild
# errors; without it the run reports only a count and points at a log file that lives on the
# runner, which makes a CI-only failure impossible to diagnose from the logs alone.
- name: Test
run: dotnet test tests/Shiny.Net.HttpServer.Tests/Shiny.Net.HttpServer.Tests.csproj --configuration Release -p:TestingPlatformShowTestsFailure=true -p:TestingPlatformCaptureOutput=false -- --report-trx --report-trx-filename test-results.trx
# always(): the point of these is the run where the Test step failed.
- name: Post Test Results
if: ${{ always() }}
uses: actions/upload-artifact@v7
with:
name: test-results
path: |
tests/**/TestResults/*.trx
tests/**/TestResults/*.log
retention-days: 5
if-no-files-found: warn
- name: Verify Native AOT
run: dotnet publish samples/Sample.Api/Sample.Api.csproj -r osx-arm64 --configuration Release
- name: Post NuGet Artifacts
uses: actions/upload-artifact@v7
with:
name: nuget-artifacts
path: '**/*.nupkg'
retention-days: 5
- name: NuGet Login (OIDC)
id: nuget-login
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/v') }}
uses: NuGet/login@v1
with:
user: aritchie
- name: Publish NuGets
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/v') }}
run: dotnet nuget push "**/*.nupkg" --source https://api.nuget.org/v3/index.json --api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }} --skip-duplicate