File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919 - uses : Cysharp/Actions/.github/actions/setup-dotnet@main
2020 - run : dotnet build -c Release
2121 - run : dotnet test -c Release --no-build
22- - run : dotnet pack -c Release --no-build -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -o $GITHUB_WORKSPACE/artifacts
22+ - run : dotnet pack -c Release --no-build -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -o $GITHUB_WORKSPACE/artifacts
Original file line number Diff line number Diff line change 1616 build-dotnet :
1717 permissions :
1818 contents : read
19+ id-token : write # required for NuGet Trusted Publish
1920 runs-on : ubuntu-24.04
2021 timeout-minutes : 10
2122 steps :
@@ -24,13 +25,27 @@ jobs:
2425 # build and pack
2526 - run : dotnet build -c Release -p:Version=${{ inputs.tag }}
2627 - run : dotnet test -c Release --no-build
27- - run : dotnet pack -c Release --no-build -p:Version=${{ inputs.tag }} -o ./publish
28+ - run : dotnet pack -c Release --no-build -p:Version=${{ inputs.tag }} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg - o ./publish
2829 # Store artifacts.
2930 - uses : Cysharp/Actions/.github/actions/upload-artifact@main
3031 with :
3132 name : nuget
3233 path : ./publish/
3334 retention-days : 1
35+ # push nuget
36+ - name : NuGet login (OIDC)
37+ uses : NuGet/login@8d196754b4036150537f80ac539e15c2f1028841 # v1.2.0
38+ id : login
39+ with :
40+ user : ${{ secrets.NUGET_USER }}
41+ - run : dotnet nuget push "./publish/*.nupkg" --skip-duplicate -s https://api.nuget.org/v3/index.json -k "${NUGET_KEY}"
42+ if : ${{ !inputs.dry-run }}
43+ env :
44+ NUGET_KEY : ${{ steps.login.outputs.NUGET_API_KEY }}
45+ - run : dotnet nuget push "./publish/*.snupkg" --skip-duplicate -s https://api.nuget.org/v3/index.json -k "${NUGET_KEY}"
46+ if : ${{ !inputs.dry-run }}
47+ env :
48+ NUGET_KEY : ${{ steps.login.outputs.NUGET_API_KEY }}
3449
3550 # release
3651 create-release :
4358 commit-id : ${{ github.sha }}
4459 dry-run : ${{ inputs.dry-run }}
4560 tag : ${{ inputs.tag }}
46- nuget-push : true
61+ nuget-push : false
4762 release-upload : false
4863 secrets : inherit
You can’t perform that action at this time.
0 commit comments