-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from bernarden/feature/increasing-version-number
Increases version number to 0.2.0. Adds package publishing script.
- Loading branch information
Showing
6 changed files
with
66 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
$ErrorActionPreference = "Stop" | ||
$PackagesDir = Join-Path -Path $PSScriptRoot -ChildPath "../Artifacts/Packages" | ||
$NugetDir = Join-Path -Path $PSScriptRoot -ChildPath "../Temp/nuget.exe" | ||
|
||
function Main { | ||
$packages = Get-ChildItem -Path $PackagesDir | ||
Write-Host "Following packages were found:" -ForegroundColor Yellow | ||
Write-Host $packages -Separator "`n" | ||
|
||
$result = Get-Approval-To-Execute | ||
switch ($result) { | ||
0 { | ||
Write-Host "Continuing..." -ForegroundColor Yellow | ||
Start-Sleep -s 10 | ||
Publish-Packages $packages | ||
} | ||
|
||
1 { | ||
Write-Host "Exiting..." -ForegroundColor Yellow | ||
} | ||
} | ||
} | ||
|
||
function Get-Approval-To-Execute { | ||
$title = "Publish Packages" | ||
$message = "Are you sure you want to publish the packages listed above to nuget.org?" | ||
$yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", "Packages will be published!" | ||
$no = New-Object System.Management.Automation.Host.ChoiceDescription "&No", "Script execution will stop." | ||
$options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no) | ||
return $host.ui.PromptForChoice($title, $message, $options, 1) | ||
} | ||
|
||
function Publish-Packages { | ||
param ( [System.Array] $Packages) | ||
|
||
$nugetExeFile = Get-Item -Path $NugetDir | ||
|
||
$symbolsPackagesPattern = ".*.symbols.nupkg" | ||
$nugetPackagesPattern = ".*(?<!\.symbols)\.nupkg" | ||
|
||
$symbolsPackages = $Packages | Where-Object {$_.Name -match $symbolsPackagesPattern} | ||
foreach ($symbolsPackage in $symbolsPackages) { | ||
Write-Host "Publishing $($symbolsPackage.Name)" -ForegroundColor Yellow | ||
$args = @("push", $symbolsPackage.FullName, "-source", "https://nuget.smbsrc.net/") | ||
& $nugetExeFile.FullName $args | ||
} | ||
|
||
$nugetPackages = $Packages | Where-Object {$_.Name -match $nugetPackagesPattern} | ||
foreach ($nugetPackage in $nugetPackages) { | ||
Write-Host "Publishing $($nugetPackage.Name)" -ForegroundColor Yellow | ||
$args = @("push", $nugetPackage.FullName, "-source", "https://api.nuget.org/v3/index.json") | ||
& $nugetExeFile.FullName $args | ||
} | ||
} | ||
|
||
Main |
4 changes: 2 additions & 2 deletions
4
Source/Vima.LoggingAbstractor.AppInsights/Vima.LoggingAbstractor.AppInsights.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
Source/Vima.LoggingAbstractor.Console/Vima.LoggingAbstractor.Console.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
Source/Vima.LoggingAbstractor.Core/Vima.LoggingAbstractor.Core.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
Source/Vima.LoggingAbstractor.Raygun/Vima.LoggingAbstractor.Raygun.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
Source/Vima.LoggingAbstractor.Sentry/Vima.LoggingAbstractor.Sentry.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters