chore: typo #172
Workflow file for this run
This file contains hidden or 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: cd | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| Publish: | |
| description: 'Publish option' | |
| required: true | |
| default: 'NuGetTest' | |
| type: choice | |
| options: | |
| - NuGet | |
| - NuGetTest | |
| push: | |
| branches: | |
| - "**" | |
| paths: | |
| - ".github/workflows/cd.yml" | |
| - "docs/build.ps1" | |
| tags: | |
| - "v*" | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| env: | |
| NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages # NuGet CLI environment variables | |
| GH_TOKEN: ${{ github.token }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| fetch-depth: 0 | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 7.0.x | |
| 9.0.x | |
| cache: true | |
| cache-dependency-path: '**/packages.lock.json' | |
| - run: dotnet restore --locked-mode | |
| - run: dotnet tool update -g dotnet-script | |
| - run: dotnet tool update -g docfx | |
| - id: build | |
| run: dotnet script ./tools/Builder/Build.csx | |
| - name: Preview CHANGELOG | |
| if: false | |
| run: | | |
| $latest = gh release view --json tagName --jq .tagName | |
| python3 tools/ChangelogGenerator/changelog_generator.py --tag "${{ steps.build.outputs.tag }}" --latest "$latest" | |
| - run: ./docs/build.ps1 | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: nupkgs | |
| path: nupkgs | |
| retention-days: 7 | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/_site | |
| outputs: | |
| tag: ${{ steps.build.outputs.tag }} | |
| version: ${{ steps.build.outputs.version }} | |
| is_release: ${{ steps.build.outputs.is_release }} | |
| is_preview: ${{ steps.build.outputs.is_preview }} | |
| test: | |
| needs: [ build ] | |
| runs-on: windows-latest | |
| if: needs.build.outputs.is_release != 'True' && github.event.inputs.Publish != 'NuGet' | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: nupkgs | |
| - name: Publish the package to nugettest.org # need secrets.NUGETTEST_TOKEN | |
| run: dotnet nuget push *.nupkg --api-key ${{ secrets.NUGETTEST_TOKEN }} --source https://apiint.nugettest.org/v3/index.json | |
| release: | |
| needs: [ build ] | |
| runs-on: windows-latest | |
| if: needs.build.outputs.is_release == 'True' || github.event.inputs.Publish == 'NuGet' | |
| permissions: | |
| contents: write | |
| pages: write # to deploy to Pages | |
| id-token: write # to verify the deployment originates from an appropriate source | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| - name: Publish the package to nuget.org # need secrets.NUGET_TOKEN | |
| run: | | |
| cd nupkgs | |
| dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json | |
| - name: Deploy to GitHub Pages | |
| uses: actions/deploy-pages@v4 | |
| - name: Re-zip docs | |
| run: | | |
| cd github-pages | |
| 7z x artifact.tar -o'${{ needs.build.outputs.version }}' | |
| 7z a docs.zip '${{ needs.build.outputs.version }}' | |
| - if: needs.build.outputs.is_release == 'True' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| body_path: CHANGELOG.md | |
| tag_name: ${{ needs.build.outputs.tag }} | |
| files: github-pages/docs.zip | |
| prerelease: ${{ needs.build.outputs.is_preview == 'True' }} |