I have a nuget package that runs Travis CI for its builds. Here is my yml:
language: csharp
solution: TreasureGen.sln
install:
- nuget restore TreasureGen.sln
Accepted answer didn't work for me (I don't know why). Following is what worked.
language: csharp
solution: [SolutionName].sln
install:
- curl -L -o nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
- mono nuget.exe restore [SolutionName].sln
script:
- xbuild /p:Configuration=Release [SolutionName].sln
- mono nuget.exe pack ./[NuspecName].nuspec
- mono nuget.exe setApiKey $NUGET_API_KEY -Source $NUGET_SOURCE -Verbosity quiet
- mono nuget.exe push [SolutionName].*.nupkg -Source $NUGET_SOURCE
$NUGET_SOURCE
, $NUGET_API_KEY
are environment variables defined in Travis.