Skip to content

documentation(ResultFactory): improve readability of parameters #206

documentation(ResultFactory): improve readability of parameters

documentation(ResultFactory): improve readability of parameters #206

Workflow file for this run

name: "Library"
on:
push:
branches:
- "main"
paths:
- "*/**.cs"
- "*/**.csproj"
- ".editorconfig"
- "*.props"
- "global.json"
- "nuget.config"
- "*.sln"
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
pull_request:
paths:
- "*/**.cs"
- "*/**.csproj"
- ".editorconfig"
- "*.props"
- "global.json"
- "nuget.config"
- "*.sln"
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
env:
RELEASE_NAME: "${{ github.ref_name }}"
NUGET_OUTPUT_DIRECTORY: "./artifacts/package/release"
jobs:
builder:
name: "Builder"
runs-on: "${{ vars.DEFAULT_UBUNTU }}"
env:
IS_PUSH_EVENT_TO_MAIN_BRANCH: "${{ github.event_name == 'push' && contains(github.ref, 'refs/heads/main') }}"
IS_RELEASE: "${{ startsWith(github.ref, 'refs/tags/v') && github.actor == github.repository_owner }}"
BUILD_CONFIGURATION: "Release"
steps:
- name: "Set up repository with all history"
uses: "actions/checkout@v4.1.6"
with:
fetch-depth: 0
- name: "Set up .NET SDK"
uses: "actions/setup-dotnet@v4.0.0"
- name: "Restore dependencies"
run: "dotnet restore"
- name: "Get all changed files"
id: "csharp-files"
uses: "tj-actions/changed-files@v44.5.2"
with:
files: "**/*.cs"
- name: "Run formatter for all changed files"
if: "${{ steps.csharp-files.outputs.any_changed == vars.POSITIVE }}"
run: |
dotnet format \
--include ${{ steps.csharp-files.outputs.all_changed_files }} \
--no-restore \
--verify-no-changes
- name: "Build artifacts"
run: |
dotnet build \
--no-restore \
--configuration '${{ env.BUILD_CONFIGURATION }}'
- name: "Run tests"
run: |
dotnet test \
--no-build \
--configuration '${{ env.BUILD_CONFIGURATION }}' \
-property:'CollectCoverage=${{ env.IS_PUSH_EVENT_TO_MAIN_BRANCH }}'
- name: "Upload coverage results"
if: "${{ env.IS_PUSH_EVENT_TO_MAIN_BRANCH == vars.POSITIVE }}"
uses: "codecov/codecov-action@v4.4.1"
with:
directory: "./artifacts/coverage"
files: "*.xml"
fail_ci_if_error: true
token: "${{ secrets.CODECOV_TOKEN }}"
- name: "Build packages"
if: "${{ env.IS_RELEASE == vars.POSITIVE }}"
run: |
dotnet pack \
--no-build \
--configuration '${{ env.BUILD_CONFIGURATION }}' \
-property:"PackageVersion=${GITHUB_REF_NAME#v}" \
-property:'PackageReleaseNotes=Please see ${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}'
- name: "Upload artifacts"
uses: "actions/upload-artifact@v4.3.3"
if: "${{ env.IS_RELEASE == vars.POSITIVE }}"
with:
name: "${{ env.RELEASE_NAME }}"
path: |
${{ env.NUGET_OUTPUT_DIRECTORY }}
global.json
nuget.config
publisher:
name: "Publisher"
needs: "builder"
if: "${{ startsWith(github.ref, 'refs/tags/v') && github.actor == github.repository_owner }}"
runs-on: "${{ vars.DEFAULT_UBUNTU }}"
env:
NUGET_SEARCH_PATTERN: "*.nupkg"
steps:
- name: "Download artifacts"
uses: "actions/download-artifact@v4.1.7"
with:
name: "${{ env.RELEASE_NAME }}"
- name: "Set up .NET SDK"
uses: "actions/setup-dotnet@v4.0.0"
- name: "Publish packages"
run: |
dotnet nuget push '${{ env.NUGET_OUTPUT_DIRECTORY }}${{ env.NUGET_SEARCH_PATTERN }}' \
--source 'nuget' \
--api-key '${{ secrets.NUGET_TOKEN }}' \
--skip-duplicate
dotnet nuget push '${{ env.NUGET_OUTPUT_DIRECTORY }}${{ env.NUGET_SEARCH_PATTERN }}' \
--source 'https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json' \
--api-key '${{ secrets.GITHUB_TOKEN }}' \
--skip-duplicate
- name: "Publish release"
uses: "softprops/action-gh-release@v2.0.5"
with:
generate_release_notes: true
files: "${{ env.NUGET_OUTPUT_DIRECTORY }}/*"