This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: .Net Build | |
description: Builds a .NET solution or project | |
branding: | |
color: green | |
icon: check | |
inputs: | |
build-args: | |
description: Additional build arguments to pass to 'dotnet build'. | |
required: false | |
build-configuration: | |
description: The build configuration to use (defaults to 'Release'). | |
required: false | |
default: Release | |
path: | |
description: The path to the project or solution to build (defaults to the current directory). | |
required: false | |
default: . | |
warnings-as-errors: | |
description: Whether to treat warnings as errors. | |
required: false | |
default: 'false' | |
runs: | |
using: composite | |
steps: | |
- name: Restore Nuget packages | |
uses: EasyDesk/action-dotnet@v1 | |
with: | |
script: dotnet restore '${{ inputs.path }}' | |
- name: Build Solution | |
uses: EasyDesk/action-dotnet@v1 | |
with: | |
script: | | |
ARGS='${{ inputs.build-args }}' | |
if [[ '${{ inputs.warnings-as-errors }}' == 'true' ]] ; then | |
ARGS="-warnaserror $ARGS" | |
fi | |
dotnet build '${{ inputs.path }}' -c '${{ inputs.build-configuration }}' --no-restore $ARGS |