Repository navigation
163 lines (146 loc) · 5.74 KB
/
Copy pathnightly.yml
File metadata and controls
163 lines (146 loc) · 5.74 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: nightly
on:
workflow_dispatch:
inputs:
validation_only:
description: 'Compare latest stable and this ref without package publication or Pages deployment'
type: boolean
default: true
schedule:
- cron: '0 0 * * *'
env:
DOCFX_PREVIEW_BUILD: true
jobs:
build-nightly-package:
if: github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && inputs.validation_only)
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- id: version
uses: paulhatch/semantic-version@v6.0.3
with:
version_format: ${major}.${minor}.${patch}-preview.${increment}
- uses: ./.github/actions/build
- name: dotnet test
run: dotnet test -c Release -f net8.0 --no-build
- name: dotnet test
run: dotnet test -c Release -f net9.0 --no-build
- name: dotnet test
run: dotnet test -c Release -f net10.0 --no-build
- name: dotnet test
run: dotnet test -c Release -f net11.0 --no-build
- name: dotnet pack
run: dotnet pack -c Release /p:Version=${{ steps.version.outputs.version }} /p:ApiCompatGenerateSuppressionFile=true -o drop/nuget
- name: Preserve exact nightly tool package
uses: actions/upload-artifact@v7
with:
name: nightly-tool-package
path: drop/nuget/docfx.${{ steps.version.outputs.version }}.nupkg
if-no-files-found: error
retention-days: 14
- name: Preserve packages for production publication
if: github.repository == 'dotnet/docfx' && github.ref == 'refs/heads/main' && !inputs.validation_only
uses: actions/upload-artifact@v7
with:
name: nightly-publication-packages
path: drop/nuget/*.nupkg
if-no-files-found: error
retention-days: 14
publish-github-packages:
if: github.repository == 'dotnet/docfx' && github.ref == 'refs/heads/main' && (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && !inputs.validation_only))
needs: [build-nightly-package]
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
packages: write
steps:
- uses: actions/setup-dotnet@v6
with:
dotnet-version: 11.x
- uses: actions/download-artifact@v8
with:
name: nightly-publication-packages
path: drop/nuget
- name: dotnet nuget push
run: dotnet nuget push drop/nuget/*.nupkg --api-key "${{ secrets.GITHUB_TOKEN }}" --skip-duplicate --source https://nuget.pkg.github.com/dotnet/index.json
test-nightly-package:
if: github.repository == 'dotnet/docfx' || (github.event_name == 'workflow_dispatch' && inputs.validation_only)
runs-on: ubuntu-latest
needs: [build-nightly-package]
timeout-minutes: 20
permissions:
contents: read
actions: read
steps:
- uses: actions/checkout@v7
- uses: actions/setup-dotnet@v6
with:
dotnet-version: 11.x
- uses: actions/download-artifact@v8
with:
name: nightly-tool-package
path: drop/nightly
- name: Install exact nightly package
shell: pwsh
env:
TOOL_VERSION: ${{ needs.build-nightly-package.outputs.version }}
run: |
$feed = [Security.SecurityElement]::Escape((Resolve-Path drop/nightly).Path)
"<configuration><packageSources><clear/><add key=`"nightly`" value=`"$feed`"/></packageSources></configuration>" | Set-Content drop/nightly/NuGet.Config
dotnet tool install docfx -g --version $env:TOOL_VERSION --framework net10.0 --configfile drop/nightly/NuGet.Config
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- name: Run docfx commands for test
working-directory: samples/seed
run: |
docfx metadata
docfx build
docfx pdf
sdk-compatibility:
if: github.repository == 'dotnet/docfx' || (github.event_name == 'workflow_dispatch' && inputs.validation_only)
needs: [build-nightly-package]
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
actions: read
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: 24
- uses: actions/download-artifact@v8
with:
name: nightly-tool-package
path: drop/nightly
- name: Resolve exact SDK candidates from official metadata
id: matrix
run: node test/compatibility/report.mjs resolve drop/compatibility-matrix.json
- uses: actions/setup-dotnet@v6
continue-on-error: true
with:
dotnet-version: ${{ steps.matrix.outputs.sdks }}
- name: Test compatibility reporting
run: node --test test/compatibility/report.test.mjs
- name: Measure and check latest stable and exact nightly packages
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
TOOL_VERSION: ${{ needs.build-nightly-package.outputs.version }}
run: |
./test/compatibility/Measure-Compatibility.ps1 -MatrixPath drop/compatibility-matrix.json -OutputDirectory drop/compatibility-report -NightlyPackage "drop/nightly/docfx.$env:TOOL_VERSION.nupkg" -NightlyFrameworks net8.0,net9.0,net10.0,net11.0
- name: Upload compatibility evidence, including failed cases
if: always()
uses: actions/upload-artifact@v7
with:
name: ${{ inputs.validation_only && 'sdk-compatibility-validation-v1' || 'sdk-compatibility-v1' }}
path: drop/compatibility-report
if-no-files-found: error
retention-days: 14