forked from ModernRonin/FluentArgumentParser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpush-package.ps1
More file actions
23 lines (21 loc) · 731 Bytes
/
push-package.ps1
File metadata and controls
23 lines (21 loc) · 731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
param ($version)
if (-not $nugetApiKey) {$nugetApiKey= $Env:NUGETAPIKEY}
if (-not $nugetApiKey)
{
Write-Host "You need to either set the powershell variable nugetApiKey or the environment variable NUGETAPIKEY before executing this script"
exit
}
if (-not $version)
{
[xml]$xml= Get-Content .\release.history
$version= $xml.Project.PropertyGroup.Version.ToString()
}
if (-not $version)
{
Write-Host "Something went wrong, could not read version from release.history"
exit
}
dotnet tool restore
dotnet paket restore
dotnet pack --configuration Release
dotnet nuget push ./ModernRonin.FluentArgumentParser/nupkg/ModernRonin.FluentArgumentParser.$version.nupkg -s https://api.nuget.org/v3/index.json --api-key $nugetApiKey