Skip to content

Build the release-branch examples against the published packages - #5083

Open
pepone wants to merge 1 commit into
icerpc:mainfrom
pepone:fix/ci-examples-published-packages
Open

pepone wants to merge 1 commit into
icerpc:mainfrom
pepone:fix/ci-examples-published-packages

Conversation

@pepone

@pepone pepone commented Nov 9, 2026

Copy link
Copy Markdown
Member

The ci workflow builds the examples after build/publish-local-packages.sh has 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 on 0.6.x (see #4969).

This PR adds a build_examples_with_published_packages job to ci.yml:

  • It runs only when the pushed branch or the PR base branch ends with .x. It is skipped on main, where the examples are meant to track the local build, and it comes along when a release branch is cut from main.
  • It builds the examples on a clean runner, without the local package publish, so restore resolves the IceRpc packages from nuget.org.
  • It turns off the NuGet cache with a new cache input on the setup-dotnet action (default true, so the other callers are unchanged). The cached ~/.nuget/packages can hold locally built packages: a version bump changes the packages.lock.json files and therefore the cache key, and the first build_and_test run with the new key saves the folder after the local publish.
  • It reuses the setup-dotnet action, 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 main this job shows as skipped. Against 0.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 on 0.6.x once this is cherry-picked there.

Fixes #4970

What's Changed entry

None — CI-only change.

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.
@pepone pepone added this to the 0.6.2 milestone Nov 9, 2026
@pepone
pepone requested review from externl and a balanced review from Copilot November 9, 2026 11:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI on 0.6.x does not build the examples against the published NuGet packages

2 participants