Skip to content

Bump Roslynator to 4.11.0 (#47) #339

Bump Roslynator to 4.11.0 (#47)

Bump Roslynator to 4.11.0 (#47) #339

Workflow file for this run

on:
push:
branches:
- main
tags:
- v*
pull_request:
workflow_dispatch:
env:
Configuration: Release
TreatWarningsAsErrors: true
WarningsNotAsErrors: 1573,1591
RunCodeAnalysis: false
RoslynatorRef: v4.11.0
RoslynatorCliRef: cli-v0.8.3
DotMarkdownRef: v0.3.0
OrangRef: v0.7.0
SnippeticaRef: v2.0.2
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build_roslynator:
runs-on: ubuntu-20.04
defaults:
run:
working-directory: "src/Tools/MetadataGenerator"
steps:
- uses: actions/checkout@v3
with:
repository: dotnet/roslynator
ref: ${{ env.RoslynatorRef }}
- run: dotnet restore
- run: dotnet build --no-restore
- run: mkdir _build
- run: dotnet "bin/Release/net7.0/Roslynator.MetadataGenerator.dll" "../.." "_build"
- uses: actions/upload-artifact@v3
with:
name: roslynator
path: src/Tools/MetadataGenerator/_build
build_roslynator_cli:
runs-on: ubuntu-20.04
defaults:
run:
working-directory: "src/CommandLine.DocumentationGenerator"
steps:
- uses: actions/checkout@v3
with:
repository: dotnet/roslynator
ref: ${{ env.RoslynatorCliRef }}
- run: dotnet restore
- run: dotnet build --no-restore
- run: mkdir "_build"
- run: dotnet "bin/Release/net8.0/Roslynator.CommandLine.DocumentationGenerator.dll" "_build" "data" "help,migrate"
- uses: actions/upload-artifact@v3
with:
name: roslynator_cli
path: src/CommandLine.DocumentationGenerator/_build
build_roslynator_ref:
runs-on: ubuntu-20.04
defaults:
run:
working-directory: tools
steps:
- uses: actions/checkout@v3
with:
repository: dotnet/roslynator
ref: ${{ env.RoslynatorRef }}
- run: |
dotnet restore generate_ref_docs.sln
dotnet build --no-restore generate_ref_docs.sln
- run: dotnet tool install -g roslynator.dotnet.cli
- name: Generate reference documentation
run: >
roslynator generate-doc generate_ref_docs.sln
--properties Configuration=Release
-o "build/ref"
--host docusaurus
--heading "Roslynator .NET API Reference"
--group-by-common-namespace
--ignored-common-parts content
--max-derived-types 10
--root-file-path "build/ref.md"
- uses: actions/upload-artifact@v3
with:
name: roslynator_ref
path: tools/build
build_roslynator_configuration:
runs-on: ubuntu-20.04
defaults:
run:
working-directory: "src/Tools/ConfigurationFileGenerator"
steps:
- uses: actions/checkout@v3
with:
repository: dotnet/roslynator
ref: ${{ env.RoslynatorRef }}
- run: dotnet restore
- run: dotnet build --no-restore
- run: dotnet "bin/Release/net7.0/Roslynator.ConfigurationFileGenerator.dll" "../.." "configuration.md" "configuration.md"
- uses: actions/upload-artifact@v3
with:
name: roslynator_configuration
path: src/Tools/ConfigurationFileGenerator/configuration.md
build_orang_cli:
runs-on: ubuntu-20.04
defaults:
run:
working-directory: src/DocumentationGenerator
steps:
- uses: actions/checkout@v3
with:
repository: josefpihrt/orang
ref: ${{ env.OrangRef }}
- run: dotnet restore
- run: dotnet build --no-restore
- run: mkdir "_build"
- run: dotnet "bin/Release/net7.0/Orang.DocumentationGenerator.dll" "_build" "data"
- uses: actions/upload-artifact@v3
with:
name: orang_cli
path: src/DocumentationGenerator/_build
build_orang_ref:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: josefpihrt/orang
ref: ${{ env.OrangRef }}
- run: |
dotnet restore
dotnet build --no-restore
working-directory: "src"
- run: dotnet tool install -g roslynator.dotnet.cli
- run: >
roslynator generate-doc "src/Orang.sln"
--properties "Configuration=Release"
--projects "Common" "FileSystem"
--heading ".NET API Reference"
-o "_build/ref"
--host docusaurus
--group-by-common-namespace
--ignored-common-parts content
--max-derived-types 10
--root-file-path "_build/ref.md"
- uses: actions/upload-artifact@v3
with:
name: orang_ref
path: _build
build_dotmarkdown:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
repository: josefpihrt/dotmarkdown
ref: ${{ env.DotMarkdownRef }}
- run: |
dotnet restore
dotnet build --no-restore
working-directory: "src/DotMarkdown"
- run: dotnet tool install -g roslynator.dotnet.cli
- run: >
roslynator generate-doc "src/DotMarkdown.sln"
--properties "Configuration=Release"
--projects "DotMarkdown(netstandard1.3)" "DotMarkdown.Docusaurus(netstandard1.3)"
--heading ".NET API Reference"
-o _build/ref
--host docusaurus
--group-by-common-namespace
--ignored-common-parts content
--ignored-root-parts all
--max-derived-types 10
- run: >
roslynator generate-doc-root "src/DotMarkdown.sln"
--properties "Configuration=Release"
--projects "DotMarkdown(netstandard1.3)" "DotMarkdown.Docusaurus(netstandard1.3)"
-o "_build/ref.md"
--host docusaurus
--heading ".NET API Reference"
--ignored-parts content
--root-directory-url ref
- uses: actions/upload-artifact@v3
with:
name: dotmarkdown
path: _build
build_snippetica:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
repository: josefpihrt/snippetica
ref: ${{ env.SnippeticaRef }}
- run: |
dotnet restore src/Snippetica.CodeGeneration.DocumentationGenerator/DocumentationGenerator.csproj
dotnet build src/Snippetica.CodeGeneration.DocumentationGenerator/DocumentationGenerator.csproj --no-restore
- run: "src/Snippetica.CodeGeneration.DocumentationGenerator/bin/Release/net6.0/Snippetica.CodeGeneration.DocumentationGenerator src _build src/Snippetica.CodeGeneration.Metadata/Data"
name: Generate documentation
- uses: actions/upload-artifact@v3
with:
name: snippetica
path: _build
build_docusaurus:
needs: [
build_roslynator,
build_roslynator_cli,
build_roslynator_ref,
build_roslynator_configuration,
build_orang_cli,
build_orang_ref,
build_dotmarkdown,
build_snippetica
]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: dotnet tool install -g GitVersion.Tool --version 5.11.1
- name: Resolve version
id: version
run: |
dotnet-gitversion
dotnet-gitversion > version.json
version="$(jq -r '.MajorMinorPatch' version.json)"
echo "Resolved version: $version"
echo "version=${version}" >> $GITHUB_OUTPUT
- run: >
sed -i 's/"version": "1.0.0"/"version": "${{ steps.version.outputs.version }}"/' package.json
- uses: actions/download-artifact@v3
name: "Download Roslynator metadata documentation"
with:
name: roslynator
path: docs/roslynator
- uses: actions/download-artifact@v3
name: "Download Roslynator CLI documentation"
with:
name: roslynator_cli
path: docs/roslynator
- uses: actions/download-artifact@v3
name: "Download Roslynator reference documentation"
with:
name: roslynator_ref
path: docs/roslynator
- uses: actions/download-artifact@v3
name: "Download Roslynator configuration"
with:
name: roslynator_configuration
path: docs/roslynator
- uses: actions/download-artifact@v3
name: "Download Orang CLI documentation"
with:
name: orang_cli
path: docs/orang
- uses: actions/download-artifact@v3
name: "Download Orang reference documentation"
with:
name: orang_ref
path: docs/orang
- uses: actions/download-artifact@v3
name: "Download DotMarkdown documentation"
with:
name: dotmarkdown
path: docs/dotmarkdown
- uses: actions/download-artifact@v3
name: "Download Snippetica documentation"
with:
name: snippetica
path: docs/snippetica
- uses: actions/checkout@v3
with:
repository: josefpihrt/wordb
path: _wordb
- run: dotnet tool install -g orang.dotnet.cli --version 0.6.0-beta
- run: >
orang spellcheck docs --dry-run --min-word-length 4
--words
spellcheck
_wordb/data/en
_wordb/data/en-us
_wordb/data/names.txt
_wordb/data/tech.names.txt
_wordb/data/tech.acronyms.txt
--exclude
dotmarkdown/ref/**/LanguageIdentifiers/**
snippetica/snippets/vs*/html.md
- run: npm install
- run: npm run build
env:
NODE_OPTIONS: "--max_old_space_size=4096"
- uses: actions/upload-artifact@v3
with:
name: docusaurus
path: build
deploy:
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
needs: build_docusaurus
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-20.04
steps:
- uses: actions/download-artifact@v3
with:
name: docusaurus
path: docusaurus
- name: Configure Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: docusaurus
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2