@@ -26,27 +26,23 @@ jobs:
26
26
with :
27
27
fetch-depth : 0 # Get all history to allow automatic versioning using MinVer
28
28
29
- # Install the .NET SDK indicated in the global.json file
30
- - name : Setup .NET
29
+ - name : Install .NET
31
30
uses : actions/setup-dotnet@v4
32
31
33
- # Cache NuGet packages
34
- - uses : actions/cache@v4
32
+ - name : Cache NuGet packages
33
+ uses : actions/cache@v4
35
34
with :
36
35
path : ~/.nuget/packages
37
36
key : ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
38
37
restore-keys : |
39
38
${{ runner.os }}-nuget-
40
39
41
- # Restore dependencies
42
40
- name : Restore dependencies
43
41
run : dotnet restore
44
42
45
- # Create the NuGet package using MSBuild to match original AppVeyor parameters for deterministic builds
46
- - name : Pack NuGet package
43
+ - name : Create NuGet package
47
44
run : dotnet msbuild -t:Pack src/UTF-unknown.csproj -p:Configuration=Release -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:ContinuousIntegrationBuild=true -p:EmbedUntrackedSources=true -p:PackageOutputPath=${{ env.NuGetDirectory }} -verbosity:minimal
48
45
49
- # Publish the NuGet package as an artifact, so they can be used in the following jobs
50
46
- name : Upload packages to artifacts
51
47
uses : actions/upload-artifact@v4
52
48
with :
@@ -59,24 +55,20 @@ jobs:
59
55
runs-on : ubuntu-latest
60
56
needs : [ create_nuget ]
61
57
steps :
62
- # Install the .NET SDK indicated in the global.json file
63
- - name : Setup .NET
58
+ - name : Install .NET
64
59
uses : actions/setup-dotnet@v4
65
60
66
- # Download the NuGet package created in the previous job
67
- - uses : actions/download-artifact@v4
61
+ - name : Download NuGet package
62
+ uses : actions/download-artifact@v4
68
63
with :
69
64
name : nuget
70
65
path : ${{ env.NuGetDirectory }}
71
66
72
- # Install nuget validator
73
67
- name : Install nuget validator
74
68
run : dotnet tool update Meziantou.Framework.NuGetPackageValidation.Tool --global
75
69
76
70
# Validate metadata and content of the NuGet package
77
71
# https://www.nuget.org/packages/Meziantou.Framework.NuGetPackageValidation.Tool#readme-body-tab
78
- # If some rules are not applicable, you can disable them
79
- # using the --excluded-rules or --excluded-rule-ids option
80
72
- name : Validate package
81
73
run : meziantou.validate-nuget-package (Get-ChildItem "${{ env.NuGetDirectory }}/*.nupkg")
82
74
@@ -98,11 +90,11 @@ jobs:
98
90
steps :
99
91
- uses : actions/checkout@v4
100
92
101
- - name : Setup .NET
93
+ - name : Install .NET
102
94
uses : actions/setup-dotnet@v4
103
95
104
- # Cache NuGet packages
105
- - uses : actions/cache@v4
96
+ - name : Cache NuGet packages
97
+ uses : actions/cache@v4
106
98
with :
107
99
path : ~/.nuget/packages
108
100
key : ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
@@ -130,14 +122,13 @@ jobs:
130
122
runs-on : ubuntu-latest
131
123
needs : [ validate_nuget, run_test ]
132
124
steps :
133
- # Download the NuGet package created in the previous job
134
- - uses : actions/download-artifact@v4
125
+ - name : Download NuGet package
126
+ uses : actions/download-artifact@v4
135
127
with :
136
128
name : nuget
137
129
path : ${{ env.NuGetDirectory }}
138
130
139
- # Install the .NET SDK indicated in the global.json file
140
- - name : Setup .NET Core
131
+ - name : Install .NET
141
132
uses : actions/setup-dotnet@v4
142
133
143
134
# Publish the NuGet package to NuGet.org
@@ -146,7 +137,7 @@ jobs:
146
137
# - Go to https://www.nuget.org/account/apikeys
147
138
# - Create a new API key
148
139
# - Copy the API key and add it as a secret in your GitHub repository with the name NUGET_API_KEY
149
- - name : Publish NuGet package
140
+ - name : Publish NuGet package to nuget.org
150
141
run : |
151
142
foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg, *.snupkg)) {
152
143
dotnet nuget push $file --api-key "${{ secrets.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
0 commit comments