@@ -12,23 +12,27 @@ jobs:
1212 runs-on : ubuntu-latest
1313
1414 steps :
15- - uses : actions/checkout@v1
16- - name : Setup .NET SDK
15+ - uses : actions/checkout@v4
16+ - name : Setup .NET SDK 6.0.x - 10.0.x
1717 uses : actions/setup-dotnet@v3
1818 with :
1919 dotnet-version : |
20+ 10.0.x
21+ 9.0.x
22+ 8.0.x
23+ 7.0.x
2024 6.0.x
2125 - name : Build with dotnet
22- run : dotnet build --configuration Release /home/runner/work/Dispose.Scope/Dispose.Scope/ DisposeScope.sln
26+ run : dotnet build --configuration Release DisposeScope.sln -p:CheckEolTargetFramework=false
2327 - name : Pack with dotnet
2428 env :
2529 VERSION : ${{ github.ref_name }}
26- run : dotnet pack /home/runner/work/Dispose.Scope/Dispose.Scope/ DisposeScope.sln --version-suffix $VERSION -o /home/runner/work /nugetpkgs -c Release --no-build
30+ run : dotnet pack DisposeScope.sln --version-suffix $VERSION -o . /nugetpkgs -c Release --no-build
2731 - name : Upload artifact
28- uses : actions/upload-artifact@v1
32+ uses : actions/upload-artifact@v4
2933 with :
3034 name : nugetpkgs
31- path : /home/runner/work/ nugetpkgs
35+ path : ./ nugetpkgs
3236
3337 release_nuget :
3438 name : Release to Nuget
@@ -37,14 +41,39 @@ jobs:
3741
3842 steps :
3943 - name : Download build artifacts
40- uses : actions/download-artifact@v1
44+ uses : actions/download-artifact@v4
4145 with :
4246 name : nugetpkgs
43- - name : list nugetpkgs
44- run : ls nugetpkgs
47+ path : .
48+ - name : Debug downloaded artifacts
49+ shell : bash
50+ run : |
51+ set -e
52+ echo "PWD: $(pwd)"
53+ echo "Top-level:"
54+ ls -la
55+ echo "NUPKG files:"
56+ ls -la *.nupkg || true
4557 - name : Release
58+ shell : bash
4659 run : |
47- for file in nugetpkgs/*.nupkg
48- do
49- dotnet nuget push $file -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate -s https://www.nuget.org/api/v2/package
60+ set -e
61+ shopt -s nullglob
62+
63+ # All non-library projects should have IsPackable=false, so we can push everything we packed.
64+ files=( *.nupkg )
65+ if [ ${#files[@]} -eq 0 ]; then
66+ echo "No .nupkg files found in workspace root."
67+ exit 1
68+ fi
69+
70+ for file in "${files[@]}"; do
71+ case "$file" in
72+ *.snupkg|*symbols*.nupkg)
73+ echo "Skipping: $file"
74+ continue
75+ ;;
76+ esac
77+ echo "Pushing: $file"
78+ dotnet nuget push "$file" -k "${{ secrets.NUGET_API_KEY }}" --skip-duplicate -s https://www.nuget.org/api/v2/package
5079 done
0 commit comments