-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yml
More file actions
74 lines (69 loc) · 2.44 KB
/
action.yml
File metadata and controls
74 lines (69 loc) · 2.44 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: 'Compile source code'
author: 'Pete Sramek'
description: 'Compiles source code, uploads build artifacts.'
inputs:
# Required
assembly-version:
description: 'Assembly version.'
required: true
assembly-informational-version:
description: 'Assembly informational version.'
required: true
file-version:
description: 'Assembly file version.'
required: true
treat-warnings-as-error:
description: 'Treat warnings as errors.'
required: true
project-path:
description: 'Search pattern for source code.'
required: true
# Optional
dotnet_sdk_version:
description: '.NET SDK version. Default: ''10.x'''
required: false
default: '10.x'
build-configuration:
description: 'Build configuration. Default: ''Release'''
required: false
default: 'Release'
build-platform:
description: 'Build platform. Deafult: ''Any CPU'''
required: false
default: 'Any CPU'
upload-build-artifacts:
description: 'Upload build artifacts, Default: ''true'''
required: false
default: 'true'
build-artifacts-glob-pattern:
description: 'Search pattern for build artifacts. Default: **/bin/*, **/obj/*'
required: false
default: |
**/bin/*
**/obj/*
build-artifacts-name:
description: 'Upload build artifacts, Default: ''build'''
required: false
default: 'build'
runs:
using: "composite"
steps:
- name: 'Checkout ${{ github.head_ref || github.ref }}'
uses: actions/checkout@v6
- name: 'Setup .NET ${{ inputs.dotnet_sdk_version }}'
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ inputs.dotnet_sdk_version }}
- if: ${{ inputs.treat-warnings-as-error == 'true' }}
name: 'Validate warnings with .NET CLI'
shell: bash
run: dotnet format analyzers --severity warn --verify-no-changes
- name: 'Build with .NET CLI'
shell: bash
run: dotnet build ${{ inputs.search-glob-pattern }} --configuration ${{ inputs.build-configuration }} /p:Platform="${{ inputs.build-platform }}" /p:Version=${{ inputs.assembly-version }} /p:AssemblyInformationalVersion=${{ inputs.assembly-informational-version }} /p:FileVersion=${{ inputs.file-version }}
- name: 'Upload build artifacts'
if: ${{ inputs.upload-build-artifacts == 'true' }}
uses: actions/upload-artifact@v7
with:
name: ${{ inputs.build-artifacts-name }}
path: ${{ inputs.build-artifacts-glob-pattern }}