ci: use OIDC for NuGet package push authentication#60
Merged
Conversation
This updates the build-release workflow to leverage OpenID Connect (OIDC) for authenticating with NuGet.org. The package push operation is now performed directly within the build job, replacing static API key usage with ephemeral credentials for enhanced security.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the release GitHub Actions workflow to publish NuGet packages using NuGet.org Trusted Publishing (OIDC) instead of a static API key, moving the push step into the build job and disabling NuGet push in the reusable create-release workflow call.
Changes:
- Add
NuGet/login(OIDC) step and performdotnet nuget pushfrom thebuildjob. - Disable
nuget-pushin thecreate-releasereusable workflow invocation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Agent-Logs-Url: https://github.com/Cysharp/GrpcWebSocketBridge/sessions/54bcd0a8-8cad-422a-aed3-b55a9700e4f2 Co-authored-by: guitarrapc <3856350+guitarrapc@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
.github/workflows/build-release.yaml:43
- The build steps set
VersionSuffix=${{ inputs.tag }}but the pack steps setVersionPrefix=${{ inputs.tag }}while using--no-build. SinceDirectory.Build.propsdefinesVersionPrefixas1.0.0, the assemblies produced bydotnet buildwill have version1.0.0-${tag}, but the resulting NuGet package version will be${tag}. Align the version properties used for build and pack (e.g., set the sameVersion/VersionPrefix/VersionSuffixon both) to avoid publishing packages whose assembly informational version does not match the package version.
- run: dotnet build ./src/GrpcWebSocketBridge.AspNetCore/ -c Release -p:VersionSuffix=${{ inputs.tag }}
- run: dotnet build ./src/GrpcWebSocketBridge.Client/ -c Release -p:VersionSuffix=${{ inputs.tag }}
- run: dotnet pack -c Release --no-build --include-source -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:VersionPrefix=${{ inputs.tag }} -o ./publish/ ./src/GrpcWebSocketBridge.AspNetCore
- run: dotnet pack -c Release --no-build --include-source -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:VersionPrefix=${{ inputs.tag }} -o ./publish/ ./src/GrpcWebSocketBridge.Client
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Cysharp/GrpcWebSocketBridge/sessions/343f0462-f3ca-4ad4-8261-3d7f198659dd Co-authored-by: guitarrapc <3856350+guitarrapc@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This updates the build-release workflow to leverage OpenID Connect (OIDC) for authenticating with NuGet.org. The package push operation is now performed directly within the build job, replacing static API key usage with ephemeral credentials for enhanced security.