nightly #268
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |