-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ben Daws
authored
Jul 8, 2024
1 parent
5f8794c
commit d0012eb
Showing
2 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
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 |
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