forked from Misterinecompany/DryIoc.Transactions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish.ps1
41 lines (30 loc) · 1.13 KB
/
publish.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env pwsh
[CmdletBinding()]
Param(
[Parameter(Mandatory = $true)]
[String]$apiKey,
[Parameter(Mandatory = $true)]
[String]$packageVersion
)
$currentPath = (Get-Location -PSProvider FileSystem).ProviderPath
$packages = New-Object System.Collections.ArrayList
$packages.Add("DryIoc.Facilities.AutoTx") > $null
$packages.Add("DryIoc.Facilities.NHibernate") > $null
$packages.Add("DryIoc.Transactions") > $null
if ($packageVersion[0] -eq 'v')
{
$packageVersion = $packageVersion.Substring(1)
}
# `dotnet build` must run before `dotnet publish` because GeneratePackageOnBuild in csproj forces not to build when running `dotnet publish` command
# https://github.com/dotnet/core/issues/1778
dotnet build -c Release "/property:Version=${packageVersion}"
dotnet publish --no-restore -c Release --no-build
Set-Location $currentPath
Set-Location build
foreach ($package in $packages)
{
$packageFullName = "${package}.${packageVersion}.nupkg"
Write-Host "Publishing ${packageFullName}"
dotnet nuget push -k "${apiKey}" "${packageFullName}" --source "http://proget.scalesoft.cz/nuget/Nuget/"
}
Set-Location $currentPath