icerpc / icerpc-csharp

A C# RPC framework built for QUIC, with bidirectional streaming, first-class async/await, and Protobuf support.
https://docs.icerpc.dev
Apache License 2.0
102 stars 13 forks source link

Use a version range for IceRPC references in project templates #4081

Open pepone opened 2 weeks ago

pepone commented 2 weeks ago

The project templates currently use an exact version match for the IceRPC packages, as seen here:

https://github.com/icerpc/icerpc-csharp/blob/9c21a5dd1625e2689cba957d226d9563710857ce/src/IceRpc.Templates/Templates/IceRpc-Protobuf-Client/IceRpc-Protobuf-Client.csproj#L15

It would be better to use a version range like "0.4.*".

However, one challenge is that we want to test these templates with CI. When using a version range, simply pushing the packages to the local global-packages folder is not sufficient. NuGet resolves the version by contacting the configured sources and checking which versions are published that match the range. Versions in the local global-packages folder are not considered during version resolution.

For the examples we use a local MSBuild variable $(IceRpcVersion), using an exact match seems more practical for the examples.

pepone commented 2 weeks ago

We use a version range on release branches "0.4.x" branch has "0.4.*", for main we use an exact version typically a preview like ("0.5.0-preview1")

We do the same for the examples, examples are configured to build agains IceRpcVersion defined in build/IceRpc.Examples.props

This means that release branches test templates and examples against the latest published version that matches the range expression. The main branch tests against the packages build from CI.