-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
46 lines (45 loc) · 1.95 KB
/
action.yml
File metadata and controls
46 lines (45 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: .NET Build from Codebelt
description: An opinionated action that builds specified projects or the solution itself including all of its dependencies.
inputs:
projects:
description: Optional path to the project(s) file to build. Pass empty to have MSBuild use the default behavior. Supports globbing. Default is an empty string.
required: true
default: ''
configuration:
description: Defines the build configuration. Default is Debug.
required: true
default: 'Debug'
framework:
description: Compiles for a specific framework. The framework must be defined in the project file. Default is an empty string.
required: true
default: ''
verbosity-level:
description: Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. The default is quiet.
required: true
default: 'quiet'
build-switches:
description: Provides a way to fully customize the build. Default is empty. See https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-command-line-reference?view=vs-2022#switches for more information.
required: false
default: ''
runs:
using: composite
steps:
- name: Build
run: |
frameworkArg=""
if [ "${{ inputs.framework }}" != "" ]; then
frameworkArg="--framework ${{ inputs.framework }}"
fi
if [ "${{ inputs.projects }}" == "" ]; then
dotnet build --configuration ${{ inputs.configuration }} --verbosity ${{ inputs.verbosity-level }} --no-restore $frameworkArg ${{ inputs.build-switches }}
else
shopt -s globstar extglob
for file in ${{ inputs.projects }}; do
dotnet build $file --configuration ${{ inputs.configuration }} --verbosity ${{ inputs.verbosity-level }} --no-restore $frameworkArg ${{ inputs.build-switches }}
echo "Built '$file'"
done
fi
shell: bash
branding:
icon: 'umbrella'
color: 'blue'