Repository navigation
Conversation
The ci workflow builds the examples after publishing the locally built packages into the NuGet global-packages folder, so restore finds the version the examples ask for locally and never contacts nuget.org. On a release branch, the examples then pass CI with a version that is not published, while a user who checks out the branch gets a restore failure. Add a job that builds the examples without the local packages. It runs only when the pushed branch or the PR base ends with ".x", so it lives on main and comes along when a release branch is cut. It also skips the NuGet cache: a version bump changes the lock files and therefore the cache key, and the first build_and_test run with the new key saves a global-packages folder that holds the locally built packages. The new setup-dotnet "cache" input turns the cache off.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the release-branch CI validation against published NuGet packages.
No open issues 🎉
What changed in this PR
Adds CI validation that release-branch examples build against published NuGet packages, preventing local packages from masking unpublished version references as described in #4970. Main-branch and DocFX example builds remain unchanged.
Changes:
- Adds a clean-runner example build for branches and PR targets ending in
.x. - Adds a default-enabled cache input to the shared .NET setup action, disabling it for the published-package check.
| File | Description |
|---|---|
.github/workflows/ci.yml |
Adds the release-branch example build without local package publishing or cache restoration. |
.github/actions/setup-dotnet/action.yaml |
Makes NuGet caching optional while preserving existing callers’ behavior. |
Review effort: Balanced
This branch has not been deployed
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.
The
ciworkflow builds the examples afterbuild/publish-local-packages.shhas pushed the freshly built packages into the runner's NuGet global-packages folder, so restore finds the version the examples ask for locally and never contacts nuget.org. On a release branch, the examples then pass CI with a version that is not published, while a user who checks out the branch gets a restore failure. This is how the 0.6.1 version bump went green on0.6.x(see #4969).This PR adds a
build_examples_with_published_packagesjob toci.yml:.x. It is skipped onmain, where the examples are meant to track the local build, and it comes along when a release branch is cut frommain.cacheinput on thesetup-dotnetaction (defaulttrue, so the other callers are unchanged). The cached~/.nuget/packagescan hold locally built packages: a version bump changes thepackages.lock.jsonfiles and therefore the cache key, and the firstbuild_and_testrun with the new key saves the folder after the local publish.setup-dotnetaction, so it picks up each branch's .NET version.The docfx examples are not concerned: they only compile the snippets of the API reference and track the repository version.
Verification: on
mainthis job shows as skipped. Against0.6.x(where the diff applies cleanly), all 38 example solutions build with an empty global-packages folder and nuget.org as the only source, restoring the published IceRpc 0.6.1 packages. The job itself runs on0.6.xonce this is cherry-picked there.Fixes #4970
What's Changed entry
None — CI-only change.