mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-05 11:42:36 +00:00
add after build script example that shows how to automatically upload packages to myget which is useful for automated builds
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
param(
|
||||
[Parameter(Position = 0, Mandatory = $true)]
|
||||
[string] $Version
|
||||
)
|
||||
|
||||
$WorkingDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
|
||||
$Nuget = Join-Path $env:LOCALAPPDATA .\nuget\NuGet.exe
|
||||
$PackagePath = Join-Path $WorkingDir\nuget
|
||||
|
||||
function Write-Diagnostic
|
||||
{
|
||||
param(
|
||||
[Parameter(Position = 0, Mandatory = $true, ValueFromPipeline = $true)]
|
||||
[string] $Message
|
||||
)
|
||||
|
||||
Write-Host
|
||||
Write-Host $Message -ForegroundColor Green
|
||||
Write-Host
|
||||
}
|
||||
|
||||
Write-Diagnostic "Uploading packages to myget"
|
||||
|
||||
$Packages = @(
|
||||
"$PackagePath\CefSharp.Common.$Version.nupkg",
|
||||
"$PackagePath\CefSharp.WinForms.$Version.nupkg",
|
||||
"$PackagePath\CefSharp.Wpf.$Version.nupkg"
|
||||
)
|
||||
|
||||
$Packages | ForEach-Object {
|
||||
. $Nuget push $_ -Source https://myget.org/F/X
|
||||
}
|
||||
@@ -222,6 +222,13 @@ function Nupkg
|
||||
. $nuget pack nuget\CefSharp.Common.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget -Properties "RedistVersion=$RedistVersion"
|
||||
. $nuget pack nuget\CefSharp.Wpf.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget
|
||||
. $nuget pack nuget\CefSharp.WinForms.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget
|
||||
|
||||
# Invoke `AfterBuild` script if available (ie. upload packages to myget)
|
||||
if(-not (Test-Path $WorkingDir\AfterBuild.ps1)) {
|
||||
return
|
||||
}
|
||||
|
||||
. $WorkingDir\AfterBuild.ps1 -Version $Version
|
||||
}
|
||||
|
||||
function DownloadNuget()
|
||||
|
||||
Reference in New Issue
Block a user