Skip to content

Commit

Permalink
Fixing the build actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Daws authored Jul 8, 2024
1 parent 5f8794c commit d0012eb
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
build:
name: .NET Build
uses: EasyDesk/action-dotnet-build@1.0.0
uses: build.yml
with:
build-args: -r win-x64 -p:PublishSingleFile=true --self-contained true
build-configuration: Release
Expand Down

0 comments on commit d0012eb

Please sign in to comment.