Skip to content

BUGFIX: Sorting out where the error is #5

BUGFIX: Sorting out where the error is

BUGFIX: Sorting out where the error is #5

name: C-Sharp Project Workflow
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
Build:
name: Build, Test and Package
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Install DefaultDocumentation
run: dotnet tool install DefaultDocumentation.Console -g
- name: Clean Project
run: |
$projectPath = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath 'CSharpProject'
$outputPath = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath 'Output'
$docsPath = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath 'Docs'
dotnet clean $projectPath --nologo -c Debug
dotnet clean $projectPath --nologo -c Release
$null = Remove-Item $outputPath -Recurse -ErrorAction Ignore
$null = New-Item -Type Directory -Path $outputPath -ErrorAction Ignore
$null = New-Item -Type Directory -Path $docsPath -ErrorAction Ignore
- name: Test Project
run: |
$projectPath = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath 'CSharpProject.Tests'
dotnet test $projectPath --nologo
- name: Build Project
run: |
$projectPath = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath 'CSharpProject'
$outputPath = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath 'Output'
dotnet build $projectPath -o $outputPath
Get-ChildItem -Path $outputPath
- name: Create Documentation
run: |
$outputPath = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath 'Output'
$docsPath = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath 'Docs'
defaultdocumentation -a $outputPath\CSharpProject.dll -o $docsPath
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "Document updates"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: mod-posh/[email protected]
with:
name: '"Our latest awesome release"'
version: '"2.0.4"'
verbose: "verbose"
body: '"This release adds some features."'
github_token: ${{ secrets.GITHUB_TOKEN }}