kontent-ai / delivery-sdk-net

Kontent.ai Delivery .NET SDK
https://www.nuget.org/packages/Kontent.Ai.Delivery
MIT License
32 stars 42 forks source link

Fix release process on GitHub actions #292

Closed Simply007 closed 1 year ago

Simply007 commented 3 years ago

Brief bug description

Current Github action release process does not set the file version of the DLLs correctly it is being set to v 1.0.0

Specifically:

On the other hand, these packages are correctly set:

Repro steps

Release a beta version according to the https://github.com/Kentico/Home/wiki/Release-&-version-management-of-.NET-projects and check the file version of the output DLLs on GithUb as well as on GitHub.

Example for delivery package could be seen here: https://github.com/Kentico/Home/wiki/Release-&-version-management-of-.NET-projects

Expected behavior

All DLLs in the nuget packages have the correct version.

Additional context

discovered during #285

It might be caused by the AssemblyInfo clash. There is already ~/Properties/AssemblyInfo.cs and GenerateAssemblyInfo being set to true on *.csproj files.

Running the same commands defined in release.yml locally on windows machine using PowerShell (mentioned because of argument format) leads to correctly set File version for the DLLs - this approach was used for version 15.0.1-beta7.

The best way to test the release process would be to create a separate branch from master, to duplicate the release.yml action, hook it to every commit to the newly created branch and remove publishing to nuget and leave only storing artifacts in GitHub action build. Then try different configurations until all versions are properly set.

Once fixed, make the same fix in:

Simply007 commented 3 years ago

I have created a test environment that will build the solution and store nuget packages in the github action build artifacts using testing github action.

Simply007 commented 3 years ago

Alright, so the issue is cased by dotnet test --no-build --verbosity normal --configuration Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover command. Before this, all version are correctly set. dotnet test does change File version!

Not sure why, and how to fix that though.

Simply007 commented 3 years ago

It might be caused by restore step - it might worth trying to disable it https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test#implicit-restore

Simply007 commented 2 years ago

Alright, so the issue is cased by dotnet test --no-build --verbosity normal --configuration Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover command. Before this, all version are correctly set. dotnet test does change File version!

Not sure why, and how to fix that though.

I have tried quoted scenario with one exception - the projects are targeting .net6 (not netstandard2.0) - the issue didn't occur.

Simply007 commented 1 year ago

Fixed in https://github.com/kontent-ai/delivery-sdk-net/pull/343