-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuget-push-local.ps1
24 lines (16 loc) · 1.02 KB
/
nuget-push-local.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
if ($null -eq $env:moss_local_nuget_feed_path) {
Write-Host "Environment variable 'moss_local_nuget_feed_path' missing"
return;
}
$localFeedPath = $env:moss_local_nuget_feed_path
if ((Test-Path -Path $localFeedPath) -eq $false) {
Write-Host "Path specified by environment variable 'moss_local_nuget_feed_path' doesn't exist: $localFeedPath"
return
}
$versionSuffix = [string]::Format("{0:yyyyMMdd}.{1}", [DateTime]::Now, [Convert]::ToInt32(([DateTime]::Now - [DateTime]::Today).TotalSeconds))
dotnet clean --configuration Release
dotnet pack --configuration Release --verbosity Normal --version-suffix $versionSuffix
$filename = Get-ChildItem .\Moss.ApiClient.SomaFm\bin\Release\*$versionSuffix.nupkg | Select-Object Name
nuget add ".\Moss.ApiClient.SomaFm\bin\Release\$($filename.Name)" -s $localFeedPath
$filename = Get-ChildItem .\Moss.ApiClient.SomaFm.Extensions\bin\Release\*$versionSuffix.nupkg | Select-Object Name
nuget add ".\Moss.ApiClient.SomaFm.Extensions\bin\Release\$($filename.Name)" -s $localFeedPath