Build And Release - STARIONGROUP/COMET-SDK-Community-Edition GitHub Wiki
Development Environment
The CDP4-COMET SDK libraries are developed using Visual Studio 2022.
The following tools are used by the Starion development team:
- Visual Studio 2022 Professional (Community Edtion will work as well)
- Resharper Ultimate 2023.1 or later
- Git Extensions
Build
The CDP4-COMET SDK solution contains two build configurations:
- debug: used while developing new features
- release: used to create a build for release
Release
When new code is pushed to the GitHub repository, an azure pipeline builds the solution and pushes pre-release nugets to a pre-release nuget feed.
https://pkgs.dev.azure.com/STARIONGROUP/CDP-SDK/_packaging/cdp4-sdk-pre-release/nuget/v3/index.json
A manual build can be created as well, follow the steps to create pre-release nugets that are not optimized using the Debug configuration or a release nugets using the Release configuration:
- Run all unit tests and verify that they pass (with the exception of those tests that may need a running server)
- Make sure the version numbers of the projects are incremented when things have changed; the project makes use of SEMVER. To bump all versions at once, uses the versionBump.sh script (usage: ./versionBump.sh x.y.z)
- Update the in the .csproj files; this will be visible on https://nuget.orgnuget.org
- Via the GitHub web-ui
draft a new release
referencing the tag and set therelease title
toVersion MAJOR.MINOR.PATCH
. The description of the release shall mention the updates referencing the GitHub issue numbers.
NOTE: The
.csproj
files contain settings that indicate that a symbols package is created as well. When usingdotnet push
to publish the packages on https://nuget.org, the symbols packages will be pushed as well
pre-release
First clean
the solution and then pack
. The pack command will build and create the nugets. The --version-suffic
parameter is used to add a suffix such as rc01
.
comet@developer:~$ dotnet clean -c Debug
comet@developer:~$ dotnet pack --version-suffix "rcxy" -c Debug
In case you want to push the new nugets to https://nuget.org use the following command. You will require an API Key. This needs to be repeated for each nuget that needs to be published.
comet@developer:~$ dotnet nuget push CDP4Common-CE.MAJOR.MINOR.PATCH-rcxy.nupkg -s https://api.nuget.org/v3/index.json --api-key "your-api-key"
Alternative way is to copy all necessary .nupkg files to a temp folder and run the following command in that folder:
comet@developer:~$ dotnet nuget push *.MAJOR.MINOR.PATCH-rcxy.nupkg -s https://api.nuget.org/v3/index.json --api-key "your-api-key"
release
First clean
the solution and then pack
. The pack command will build and create the nugets. The --include-source
parameter is used to add the symbols and the source code to a specific symbols nuget. The symbols nuget will automatically be pushed to https://nuget.smbsrc.net.
comet@developer:~$ dotnet clean -c Release CDP4-SDK.sln
comet@developer:~$ dotnet pack -c Release CDP4-SDK.sln
In case you want to push the new nugets to https://nuget.org use the following command. You will require an API Key. This needs to be repeated for each nuget that needs to be published.
comet@developer:~$ dotnet nuget push CDP4Common-CE.MAJOR.MINOR.PATCH.nupkg -s https://api.nuget.org/v3/index.json --api-key "your-api-key"
Alternative way is to copy all the necessary .nupkg files to a temp folder and run the following command in that folder:
comet@developer:~$ dotnet nuget push *.MAJOR.MINOR.PATCH.nupkg -s https://api.nuget.org/v3/index.json --api-key "your-api-key"