@@ -4,9 +4,13 @@ name: dotnet-CI
44
55# Trigger the action on push to master
66on :
7+ workflow_call : [] # Allow reusing this workflow
78 push :
89 branches :
9- - master
10+ - master # Run for pushes to master
11+ pull_request :
12+ branches :
13+ - ' *' # Run the workflow for all pull requests
1014
1115# Sets permissions of the GITHUB_TOKEN to allow reading packages
1216permissions :
4044 uses : actions/setup-dotnet@v4
4145 with :
4246 source-url : https://nuget.pkg.github.com/MonkeyModdingTroop/index.json
43-
44- # Cache NuGet packages
45- - uses : actions/cache@v4
47+
48+ - name : Cache NuGet Packages
49+ uses : actions/cache@v4
4650 with :
4751 path : ~/.nuget/packages
4852 key : ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
@@ -58,25 +62,30 @@ jobs:
5862
5963 - name : Test
6064 run : dotnet test --no-restore --no-build
65+
66+ - name : Move NuGet Packages
67+ run : mv (Get-ChildItem -Recurse ./ -Include *.nupkg) ./
6168
6269 # Publish the NuGet package(s) as an artifact, so they can be used in the following jobs
63- - uses : actions/upload-artifact@v4
70+ - name : Upload NuGet Packages Artifact
71+ uses : actions/upload-artifact@v4
6472 with :
65- name : nuget
73+ name : NuGet Packages
6674 if-no-files-found : error
6775 retention-days : 7
68- path : ./**/* .nupkg
76+ path : ./*.nupkg
6977
7078 Validate-NuGet :
7179 runs-on : ubuntu-latest
7280 needs : [ Build ]
7381 steps :
74- # Install the .NET SDK indicated in the global.json file
7582 - name : Setup Dotnet
7683 uses : actions/setup-dotnet@v4
84+ with :
85+ source-url : https://nuget.pkg.github.com/MonkeyModdingTroop/index.json
7786
78- # Cache NuGet packages
79- - uses : actions/cache@v4
87+ - name : Cache NuGet Packages
88+ uses : actions/cache@v4
8089 with :
8190 path : ~/.nuget/packages
8291 key : ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
8695 - name : Install NuGet Validator
8796 run : dotnet tool update Meziantou.Framework.NuGetPackageValidation.Tool --global
8897
89- # Download the NuGet package created in the previous job
90- - uses : actions/download-artifact@v4
98+ - name : Download NuGet Packages Artifact
99+ uses : actions/download-artifact@v4
91100 with :
92101 name : nuget
93102 path : ${{ env.NuGetDirectory }}
97106 # If some rules are not applicable, you can disable them
98107 # using the --excluded-rules or --excluded-rule-ids option
99108 - name : Validate Package(s)
100- run : meziantou.validate-nuget-package (Get-ChildItem -Recurse "${{ env.NuGetDirectory }}/ *.nupkg" ) --excluded-rules IconMustBeSet
109+ run : meziantou.validate-nuget-package (Get-ChildItem -Recurse "${{ env.NuGetDirectory }}" -Include *.nupkg) --excluded-rules IconMustBeSet
0 commit comments