Skip to content

Commit dd8676e

Browse files
committed
Build & deploy doc site (#167)
1 parent 19c0637 commit dd8676e

File tree

13 files changed

+91
-302
lines changed

13 files changed

+91
-302
lines changed

.editorconfig

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
# You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
2-
[*.{csproj,props}]
2+
3+
#use soft tabs (spaces) for indentation
4+
indent_style = space
5+
6+
[*.{csproj,props,yml}]
37
indent_size = 2
8+
49
[*.cs]
510

611
#Core editorconfig formatting - indentation
712

8-
#use soft tabs (spaces) for indentation
9-
indent_style = space
10-
1113
#Formatting - indentation options
14+
indent_size = 4
1215

1316
#indent switch case contents.
1417
csharp_indent_case_contents = true
Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
on:
2-
workflow_call:
2+
workflow_call:
33
inputs:
44
feedUrl:
5-
description: 'NuGet feed URL'
5+
description: "NuGet feed URL"
66
required: true
77
type: string
88
forRelease:
9-
description: 'Run for release?'
9+
description: "Run for release?"
1010
required: true
1111
type: boolean
1212
secrets:
1313
feedAPIKey:
14-
description: 'NuGet feed API key'
14+
description: "NuGet feed API key"
1515
required: true
1616

1717
jobs:
@@ -20,42 +20,42 @@ jobs:
2020
fail-fast: false
2121
runs-on: windows-latest
2222
steps:
23-
- name: Checkout
24-
uses: actions/checkout@v4
25-
with:
26-
fetch-depth: 0
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
2727

28-
- name: Git Semantic Version
29-
id: version
30-
uses: PaulHatch/semantic-version@v5.4.0
31-
with:
32-
tag_prefix: ''
33-
version_format: "${major}.${minor}.${patch}${{ !inputs.forRelease && '-preview${increment}' || '' }}"
34-
search_commit_body: true
28+
- name: Git Semantic Version
29+
id: version
30+
uses: PaulHatch/semantic-version@v5.4.0
31+
with:
32+
tag_prefix: ""
33+
version_format: "${major}.${minor}.${patch}${{ !inputs.forRelease && '-preview${increment}' || '' }}"
34+
search_commit_body: true
3535

36-
- name: Setup dotnet ${{ env.DOTNET_VERSION }}
37-
uses: actions/setup-dotnet@v4
38-
with:
39-
dotnet-version: ${{ env.DOTNET_VERSION }}
36+
- name: Setup dotnet ${{ env.DOTNET_VERSION }}
37+
uses: actions/setup-dotnet@v4
38+
with:
39+
dotnet-version: ${{ env.DOTNET_VERSION }}
4040

41-
- name: Build and Pack
42-
run: dotnet build -c Release -p:Version=${{ steps.version.outputs.version}}
41+
- name: Build and Pack
42+
run: dotnet build -c Release -p:Version=${{ steps.version.outputs.version}}
4343

44-
- name: Run tests
45-
run: dotnet test -c Release --no-build
44+
- name: Run tests
45+
run: dotnet test -c Release --no-build
4646

47-
- name: Upload dotnet test results
48-
uses: dorny/test-reporter@v1.8.0
49-
if: ${{ !cancelled() }}
50-
with:
51-
name: .NET Tests
52-
path: 'TestResults/**/*.trx'
53-
reporter: dotnet-trx
54-
fail-on-error: true
55-
56-
- name: Push to NuGet package feed
57-
env:
58-
NUGET_URL: ${{ inputs.feedUrl }}
59-
NUGET_API_KEY: ${{ secrets.feedAPIKey }}
60-
run: dotnet nuget push '**/*.nupkg' --source "$($env:NUGET_URL)" --api-key "$($env:NUGET_API_KEY)"
61-
if: github.event_name == 'push'
47+
- name: Upload dotnet test results
48+
uses: dorny/test-reporter@v1.8.0
49+
if: ${{ !cancelled() }}
50+
with:
51+
name: .NET Tests
52+
path: "TestResults/**/*.trx"
53+
reporter: dotnet-trx
54+
fail-on-error: true
55+
56+
- name: Push to NuGet package feed
57+
env:
58+
NUGET_URL: ${{ inputs.feedUrl }}
59+
NUGET_API_KEY: ${{ secrets.feedAPIKey }}
60+
run: dotnet nuget push '**/*.nupkg' --source "$($env:NUGET_URL)" --api-key "$($env:NUGET_API_KEY)"
61+
if: github.event_name == 'push'

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ jobs:
2727
forRelease: false
2828
secrets:
2929
feedAPIKey: ${{ secrets.MYGET_CI_API_KEY }}
30+
31+
generate_docs:
32+
uses: ./.github/workflows/generateDocs.yml

.github/workflows/generateDocs.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
on:
2+
workflow_call:
3+
inputs: {}
4+
jobs:
5+
build:
6+
strategy:
7+
fail-fast: false
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
- name: Build documenation site
13+
uses: nunit/docfx-action@v3.1.0
14+
with:
15+
args: docs/docfx.json
16+
- name: Upload documentation archive
17+
uses: actions/upload-pages-artifact@v3
18+
with:
19+
path: artifacts/_site

.github/workflows/release.yml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ name: Release
33
on:
44
push:
55
tags:
6-
- '*.*.*'
7-
6+
- "*.*.*"
7+
88
concurrency:
99
group: ${{ github.workflow }}-${{ github.ref }}
1010
cancel-in-progress: true
1111

1212
env:
13-
DOTNET_VERSION: '8.0.x'
13+
DOTNET_VERSION: "8.0.x"
1414

1515
permissions:
1616
checks: write
@@ -26,18 +26,8 @@ jobs:
2626
feedAPIKey: ${{ secrets.NUGET_API_KEY }}
2727

2828
generate_docs:
29-
runs-on: ubuntu-latest
30-
steps:
31-
- name: Checkout
32-
uses: actions/checkout@v4
33-
- name: Build documenation site
34-
uses: nunit/docfx-action@v3.1.0
35-
with:
36-
args: docs/docfx.json
37-
- name: Upload documentation archive
38-
uses: actions/upload-pages-artifact@v3
39-
with:
40-
path: artifacts/_site
29+
uses: ./.github/workflows/generateDocs.yml
30+
4131
publish_docs:
4232
needs: [call_buildAndPublish, generate_docs]
4333
permissions:
@@ -48,6 +38,6 @@ jobs:
4838
url: ${{ steps.deployment.outputs.url }}
4939
runs-on: ubuntu-latest
5040
steps:
51-
- name: Publish documentation
52-
uses: actions/deploy-pages@v4
53-
id: deployment
41+
- name: Publish documentation
42+
uses: actions/deploy-pages@v4
43+
id: deployment

Directory.Packages.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
2121
<PackageVersion Include="Moq" Version="4.20.70" />
2222
<PackageVersion Include="Seq.Extensions.Logging" Version="8.0.0" />
23-
<PackageVersion Include="SourceLink.Create.CommandLine" Version="2.8.3" PrivateAssets="All" />
2423
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
2524
<PackageVersion Include="xunit" Version="2.7.0" />
2625
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.7">

0 commit comments

Comments
 (0)