77 inputs :
88 version :
99 description : ' Package version (e.g., 1.0.0)'
10- required : true
10+ required : false
1111
1212jobs :
1313 publish :
14- runs-on : windows -latest
14+ runs-on : ubuntu -latest
1515
1616 steps :
1717 - uses : actions/checkout@v4
@@ -21,32 +21,24 @@ jobs:
2121 with :
2222 dotnet-version : ' 8.0.x'
2323
24- - name : Create artifacts directory
25- run : New-Item -ItemType Directory -Force -Path ./artifacts
24+ - name : Build
25+ run : dotnet build --configuration Release
2626
27- - name : Build and Pack
28- run : dotnet pack --configuration Release --output ./artifacts
27+ - name : Pack
28+ run : dotnet pack --configuration Release --no-build -- output ./artifacts
2929
30- - name : List artifacts directory
30+ - name : List packages
3131 run : |
32- Write-Host "Contents of artifacts directory:"
33- Get-ChildItem ./artifacts -ErrorAction SilentlyContinue | ForEach-Object { Write-Host $_.FullName }
34- Write-Host "Looking for .nupkg files:"
35- $packages = Get-ChildItem ./artifacts -Filter *.nupkg -ErrorAction SilentlyContinue
36- if ($packages) {
37- Write-Host "Found $($packages.Count) package(s):"
38- $packages | ForEach-Object { Write-Host $_.FullName }
39- } else {
40- Write-Host "ERROR: No .nupkg files found!"
41- exit 1
42- }
32+ echo "Contents of artifacts directory:"
33+ ls -la ./artifacts/ || echo "Directory not found"
34+ echo "Looking for .nupkg files:"
35+ find ./artifacts -name "*.nupkg" 2>/dev/null || echo "No packages found"
4336
4437 - name : Publish to NuGet
4538 run : |
46- $packages = Get-ChildItem ./artifacts -Filter *.nupkg
47- foreach ($package in $packages) {
48- Write-Host "Publishing $($package.Name)..."
49- dotnet nuget push $package.FullName --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
50- }
51-
52-
39+ for package in ./artifacts/*.nupkg; do
40+ if [ -f "$package" ]; then
41+ echo "Publishing $package..."
42+ dotnet nuget push "$package" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
43+ fi
44+ done
0 commit comments