-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
70 lines (65 loc) · 2.19 KB
/
action.yml
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
name: .NET Pack
description: An opinionated action that retrieve previously build projects and packs them into a NuGet package.
inputs:
configuration:
description: Defines the build configuration. Default is Release.
required: true
default: 'Release'
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'
uploadPackedArtifact:
description: Upload the created NuGet packages. Default is to not upload.
required: false
default: 'false'
version:
description: The version of your project, e.g. 1.0.0.
required: true
restoreCacheKey:
description: When set, current workspace will be overwritten with the content of the restore cache. Default is empty.
required: false
default: ''
runs:
using: composite
steps:
- if: inputs.restoreCacheKey != ''
name: Restore
uses: actions/cache/restore@v4
with:
path: |
${{ github.workspace }}
!${{ github.workspace }}/.git
~/.nuget/packages
key: ${{ inputs.restoreCacheKey }}
restore-keys: |
dotnet-restore-
enableCrossOsArchive: true
fail-on-cache-miss: true
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
pattern: '*-${{ inputs.configuration }}'
merge-multiple: true
- name: Set Version
run: |
echo "MINVERVERSIONOVERRIDE=${{ inputs.version }}" >> $GITHUB_ENV
shell: bash
- if: inputs.restoreCacheKey == ''
name: Pack (Pre-requisite)
uses: codebeltnet/dotnet-restore@v2
- name: Pack
run: |
dotnet pack --configuration ${{ inputs.configuration }} --verbosity ${{ inputs.level }} --no-build --output ${{ runner.temp }}/.nuget
shell: bash
- if: inputs.uploadPackedArtifact == 'true'
name: Upload NuGet Artifacts
uses: actions/upload-artifact@v4
with:
name: NuGet-${{ inputs.configuration }}
path: ${{ runner.temp }}/.nuget
if-no-files-found: error
include-hidden-files: true
branding:
icon: 'umbrella'
color: 'blue'