Repository navigation
Use NuGet Trusted Publishing and update workflow actions - #718
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Updated [QRCoder](https://github.com/Shane32/QRCoder) from 1.8.1 to 1.9.0. <details> <summary>Release notes</summary> _Sourced from [QRCoder's releases](https://github.com/Shane32/QRCoder/releases)._ ## 1.9.0 ## What's Changed * Update to .NET 10 SDK and .slnx solution file format by @KrisVandermotten in Shane32/QRCoder#707 * Optimize QRCodeData.SaveRawData and QRCodeData.GetRawData by @KrisVandermotten in Shane32/QRCoder#708 * Optimize rawData QrCodeData constructor and improve input validation by @KrisVandermotten in Shane32/QRCoder#709 * Allow GiroCode generation without an amount by @OidaTiftla in Shane32/QRCoder#710 * Fix build by removing stale raw-data assertion by @Shane32 in Shane32/QRCoder#711 * Replace string concatenation with StringBuilder and invariant interpolation by @kamilla11 in Shane32/QRCoder#696 * Reduce PDF rendering allocations with a shared content builder by @Shane32 in Shane32/QRCoder#712 * Avoid temporary color arrays in PDF and bitmap renderers by @Shane32 in Shane32/QRCoder#713 * Enforce variable declaration style and format solution by @Shane32 in Shane32/QRCoder#714 * Format the SwissQrCode amount with the invariant culture by @menes97 in Shane32/QRCoder#715 * Simplify date formatting inside AppendInvariant calls by @Shane32 in Shane32/QRCoder#717 * Use NuGet Trusted Publishing and update workflow actions by @Shane32 in Shane32/QRCoder#718 * Run NuGet release publishing from the package output directory by @Shane32 in Shane32/QRCoder#719 ## New Contributors * @OidaTiftla made their first contribution in Shane32/QRCoder#710 * @kamilla11 made their first contribution in Shane32/QRCoder#696 * @menes97 made their first contribution in Shane32/QRCoder#715 **Full Changelog**: Shane32/QRCoder@v1.8.1...v1.9.0 Commits viewable in [compare view](Shane32/QRCoder@v1.8.1...v1.9.0). </details> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Summary
The GitHub release workflow currently publishes to NuGet.org using a long-lived
NUGET_AUTH_TOKENsecret. Replace it withNuGet/login@v1, which exchanges the release job's GitHub OIDC token for a temporary NuGet API key immediately before publishing.The job uses the
nugetenvironment with explicitid-token: writepermission andcontents: writefor the existing release asset upload. Remove the legacy setup-dotnet feed authentication and publish explicitly to NuGet.org. Therelease: publishedtrigger, versioning, package build, and artifact uploads are preserved.Update all GitHub Actions dependencies across the release, CI, pull-request test, and formatting workflows to their latest stable major tags: checkout v7, setup-dotnet v6, upload-artifact v7, github-script v9, and codecov-action v7. NuGet/login remains on the current v1 major. All references use major version tags.
One-time setup before publishing a release
In GitHub repository settings → Environments, create an environment named
nuget. For deployment branches and tags, choose Selected branches and tags and add a Tag rule forv*. Under Environment variables, add a variable namedNUGET_USERcontaining the NuGet profile username that creates the policy (not an email address or organization name). The workflow reads this non-sensitive username through${{ vars.NUGET_USER }}. Required reviewers are optional.Sign in to NuGet.org as that user and open Trusted Publishing from the account menu. Create a GitHub policy using these values:
Shane32QRCoderwf-build-release.yml(filename only)nugetSelect the policy owner that owns the packages. Scope it to publishing new versions of
QRCoderandQRCoder.Xaml; if using a package glob,QRCoder*covers both.Merge this PR, then create the next
v...release tag from a commit containing the updated workflow and publish the GitHub release. An older release tag retains its older workflow.After the first successful publish, revoke the old NuGet API key if it has no other consumers and remove the unused GitHub
NUGET_AUTH_TOKENsecret.There is no new long-lived API key to create and no need to broaden the repository's default workflow token permissions. Setup follows NuGet's Trusted Publishing guidance, the official login action, and GitHub environment configuration.
Test plan
actionlintv1.7.12 on all four workflows.git diff --check.Summary by CodeRabbit