One of the best way to reach this goal - introduce CI/CD into your project/repository.
In your situation it is better to choose cloud solution.
Tools
There are a lot of cool instruments for this purpose:
I can describe few tools that I am use.
Github Actions
- In marketplace of Github Actions you can find template and example of configuration
- Also there is soluiton for this How to push nuget package in GitHub actions
- And there is helpful article
AppVeyor
To configure this CI, do the following steps:
- Create account on AppVeyor, login and add your project to CI
- Create
appveyor.yml file in your root repository
- In
yml script you need to configure - image, build_script, version.
Example:
image: Visual Studio 2019
build_script:
- ps: dotnet --info
- ps: dotnet restore VarEnc.sln
- ps: dotnet build VarEnc.sln
version: 0.0.1.{build}
- Add
deploy section in your appveyor.yml file
deploy:
- provider: NuGet
server: path to nuget org your package
api_key:
secure: ...
skip_symbols: true
on:
branch: master
- provider: NuGet
name: production
api_key:
secure: ...
on:
branch: master
appveyor_repo_tag: true
For more information about AppVeyor publish you can find in official documentation or helpful article from Andrew Lock
Travis CI
The same situation for Travis CI tool, but yml file will be a little bit different.
- The same step from
AppVeyor approach
- Create
.travis.yml file in your root repository
- Configure initial
yml script
language: csharp
dist: xenial
sudo: required
solution: VarEnc.sln
mono: none
dotnet: 3.1
script:
- dotnet --version
- dotnet restore
- dotnet build
- Configure deploy in script. Solution you can find here - How do I deploy nuget packages in Travis CI?
Enjoy of configuring your CI in project! 