Reputation: 21
I have a Github repository for a C# Class Library project:
https://github.com/JosepeDev/VarEnc
I've created a NuGet package file through Visual Studio and uploaded it to Nuget:
https://www.nuget.org/packages/VarEnc/
How can I link this NuGet package to my GitHub packages?
Should I use Actions?
Upvotes: 2
Views: 520
Reputation: 1063
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.
There are a lot of cool instruments for this purpose:
I can describe few tools that I am use.
To configure this CI, do the following steps:
appveyor.yml
file in your root repositoryyml
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}
deploy
section in your appveyor.yml
filedeploy:
- 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
The same situation for Travis CI
tool, but yml file will be a little bit different.
AppVeyor
approach.travis.yml
file in your root repositoryyml
scriptlanguage: csharp
dist: xenial
sudo: required
solution: VarEnc.sln
mono: none
dotnet: 3.1
script:
- dotnet --version
- dotnet restore
- dotnet build
Enjoy of configuring your CI in project!
Upvotes: 4