forked from dotnet/docfx
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (70 loc) · 2.35 KB
/
nightly.yml
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
name: nightly
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
env:
DOCFX_PREVIEW_BUILD: true
jobs:
publish-github-packages:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: version
uses: paulhatch/[email protected]
with:
version_format: ${major}.${minor}.${patch}-preview.${increment}
- uses: ./.github/actions/build
- name: dotnet test
id: test-net90
run: dotnet test -c Release -f net9.0 --no-build
- name: Report failed tests
if: ${{ failure() && steps.test-net90.outcome == 'failure' }}
uses: ./.github/actions/report-failed-tests
- name: dotnet pack
run: dotnet pack -c Release /p:Version=${{ steps.version.outputs.version }} /p:ApiCompatGenerateSuppressionFile=true -o drop/nuget
- name: dotnet nuget push
if: github.repository == 'dotnet/docfx'
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'
runs-on: ubuntu-latest
needs: [publish-github-packages]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create NuGet.config
shell: pwsh
run: |
@'
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="github" value="https://nuget.pkg.github.com/dotnet/index.json" />
</packageSources>
<packageSourceCredentials>
<github>
<add key="Username" value="%USER%" />
<add key="ClearTextPassword" value="%GITHUB_TOKEN%" />
</github>
</packageSourceCredentials>
</configuration>
'@ | Out-File NuGet.config -Encoding UTF8
- name: Install nightly build package
run: |
dotnet tool install docfx -g --prerelease
- name: Run docfx commands for test
working-directory: samples/seed
run: |
docfx metadata
docfx build
docfx pdf