Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
on:
workflow_call:
inputs:
forRelease:
description: 'Run for release?'
required: true
type: boolean

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0

- name: Git Semantic Version
id: version
uses: PaulHatch/semantic-version@v6.0.3
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
with:
tag_prefix: ''
version_format: "${major}.${minor}.${patch}${{ !inputs.forRelease && '-preview${increment}' || '' }}"
search_commit_body: true

- name: Setup dotnet from global.json
uses: actions/setup-dotnet@v6
with:
global-json-file: global.json

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

- name: Run tests
run: dotnet test -c Release --no-build --report-trx --report-trx-filename "{asm}_report.trx" --coverage --coverage-output-format cobertura

- name: Upload dotnet test results
uses: dorny/test-reporter@v3.0.0
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
if: ${{ !cancelled() }}
with:
name: .NET Tests
path: 'TestResults/*_report.trx'
reporter: dotnet-trx
fail-on-error: true

- name: Install ReportGenerator
run: dotnet tool install --global dotnet-reportgenerator-globaltool

- name: Generate code coverage report
run: |
reportgenerator \
-reports:"**/TestResults/**/*.cobertura.xml" \
-targetDir:"codecoveragereport" \
-reporttypes:"Html;MarkdownSummaryGitHub"

- name: Publish code coverage summary
run: cat codecoveragereport/SummaryGithub.md >> $GITHUB_STEP_SUMMARY

- name: Upload code coverage report
uses: actions/upload-artifact@v7
with:
name: code-coverage-report
path: codecoveragereport

- name: Upload package artifact
uses: actions/upload-artifact@v7
with:
name: packages
path: "**/*.nupkg"
61 changes: 0 additions & 61 deletions .github/workflows/buildAndPublish.yml

This file was deleted.

22 changes: 13 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,25 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
DOTNET_VERSION: '9.0.x'

permissions:
checks: write
contents: read

jobs:
call_buildAndPublish:
uses: ./.github/workflows/buildAndPublish.yml
build:
uses: ./.github/workflows/build.yml
with:
feedUrl: https://www.myget.org/F/mgrosperrin/api/v3/index.json
forRelease: false
secrets:
feedAPIKey: ${{ secrets.MYGET_CI_API_KEY }}

generate_docs:
uses: ./.github/workflows/generateDocs.yml
uses: ./.github/workflows/generate-docs.yml

publish_package:
needs: build
uses: ./.github/workflows/publish-packages-myget.yml
with:
feedUrl: https://www.myget.org/F/mgrosperrin/api/v3/index.json
environmentName: myget
secrets:
feedAPIKey: ${{ secrets.MYGET_CI_API_KEY }}
if: github.event_name == 'push'
11 changes: 4 additions & 7 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ on:
schedule:
- cron: '38 16 * * 5'

env:
DOTNET_VERSION: '9.0.x'

jobs:
analyze:
name: Analyze
Expand All @@ -29,18 +26,18 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v7

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}

- name: Setup dotnet ${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v5
- name: Setup dotnet from global.json
uses: actions/setup-dotnet@v6
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
global-json-file: global.json

- name: Build projects
run: dotnet build -c Release
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
on:
workflow_call:
inputs: {}

jobs:
build:
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Build documenation site
uses: nunit/docfx-action@v4.1.0
uses: actions/checkout@v7

- name: Build documentation site
uses: wechooz/docfx-action@v10.0.0
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
with:
args: docs/docfx.json

- name: Upload documentation archive
uses: actions/upload-pages-artifact@v4
uses: actions/upload-pages-artifact@v5
with:
path: artifacts/_site

32 changes: 32 additions & 0 deletions .github/workflows/publish-packages-myget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
on:
workflow_call:
inputs:
environmentName:
description: "Name of the environment"
required: true
type: string
feedUrl:
description: 'NuGet feed URL'
required: true
type: string
secrets:
feedAPIKey:
description: 'NuGet feed API key'
required: true

jobs:
publish:
runs-on: ubuntu-latest
environment:
name: ${{ inputs.environmentName }}
steps:
- name: Download package artifact
uses: actions/download-artifact@v8
with:
name: packages

- name: Push to NuGet package feed
env:
NUGET_URL: ${{ inputs.feedUrl }}
NUGET_API_KEY: ${{ secrets.feedAPIKey }}
run: dotnet nuget push '**/*.nupkg' --source "$NUGET_URL" --api-key "$NUGET_API_KEY"
33 changes: 33 additions & 0 deletions .github/workflows/publish-packages-nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
on:
workflow_call:
inputs:
environmentName:
description: "Name of the environment"
required: true
type: string
secrets:
owner:
description: 'NuGet feed owner'
required: true

jobs:
publish:
runs-on: ubuntu-latest
environment:
name: ${{ inputs.environmentName }}
permissions:
id-token: write
steps:
- name: Download package artifact
uses: actions/download-artifact@v8
with:
name: packages

- name: NuGet login (OIDC → temp API key)
uses: NuGet/login@v1
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
id: login
with:
user: ${{ secrets.owner }}

- name: Push to NuGet package feed
run: dotnet nuget push '**/*.nupkg' --source https://api.nuget.org/v3/index.json --api-key ${{steps.login.outputs.NUGET_API_KEY}}
25 changes: 14 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,30 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
DOTNET_VERSION: "9.0.x"

permissions:
checks: write
contents: read

jobs:
call_buildAndPublish:
uses: ./.github/workflows/buildAndPublish.yml
build:
uses: ./.github/workflows/build.yml
with:
feedUrl: https://api.nuget.org/v3/index.json
forRelease: true
secrets:
feedAPIKey: ${{ secrets.NUGET_API_KEY }}

generate_docs:
uses: ./.github/workflows/generateDocs.yml
uses: ./.github/workflows/generate-docs.yml

publish_package:
needs: [build, generate_docs]
uses: ./.github/workflows/publish-packages-nuget.yml
with:
environmentName: nuget
secrets:
owner: ${{ secrets.NUGET_OWNER }}
if: github.event_name == 'push'

publish_docs:
needs: [call_buildAndPublish, generate_docs]
needs: [publish_package, generate_docs]
permissions:
pages: write
id-token: write
Expand All @@ -39,5 +42,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Publish documentation
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v5
id: deployment
26 changes: 10 additions & 16 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,17 @@
</PropertyGroup>

<ItemGroup>
<PackageVersion Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyModel" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyModel" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="10.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
<PackageVersion Include="NSubstitute" Version="5.3.0" />
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.9.0" />
<PackageVersion Include="Microsoft.Testing.Extensions.TrxReport" Version="2.3.3" />
<PackageVersion Include="NSubstitute" Version="6.0.0" />
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageVersion Include="xunit.v3" Version="3.2.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageVersion>
<PackageVersion Include="xunit.v3.mtp-v2" Version="3.2.2" />
</ItemGroup>
</Project>
Loading
Loading