File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020 - uses : Cysharp/Actions/.github/actions/setup-dotnet@main
2121 - run : dotnet build -c Release
2222 - run : dotnet test -c Release --no-build
23- - run : dotnet pack -c Release --no-build -p:IncludeSymbols=true -o $GITHUB_WORKSPACE/artifacts
23+ - 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,12 +25,26 @@ jobs:
2425 - run : dotnet build -c Release -p:Version=${{ inputs.tag }}
2526 - run : dotnet test -c Release --no-build
2627 # pack nuget
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 - uses : Cysharp/Actions/.github/actions/upload-artifact@main
2930 with :
3031 name : nuget
3132 path : ./publish
3233 retention-days : 1
34+ # push nuget
35+ - name : NuGet login (OIDC)
36+ uses : NuGet/login@8d196754b4036150537f80ac539e15c2f1028841 # v1.2.0
37+ id : login
38+ with :
39+ user : ${{ secrets.NUGET_USER }}
40+ - run : dotnet nuget push "./publish/*.nupkg" --skip-duplicate -s https://api.nuget.org/v3/index.json -k "${NUGET_KEY}"
41+ if : ${{ !inputs.dry-run }}
42+ env :
43+ NUGET_KEY : ${{ steps.login.outputs.NUGET_API_KEY }}
44+ - run : dotnet nuget push "./publish/*.snupkg" --skip-duplicate -s https://api.nuget.org/v3/index.json -k "${NUGET_KEY}"
45+ if : ${{ !inputs.dry-run }}
46+ env :
47+ NUGET_KEY : ${{ steps.login.outputs.NUGET_API_KEY }}
3348
3449 # release
3550 create-release :
4257 commit-id : ${{ github.sha }}
4358 dry-run : ${{ inputs.dry-run }}
4459 tag : ${{ inputs.tag }}
45- nuget-push : true
60+ nuget-push : false
4661 secrets : inherit
You can’t perform that action at this time.
0 commit comments