forked from Azure/azure-webjobs-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Build.ps1
54 lines (44 loc) · 1.79 KB
/
Build.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
42
43
44
45
46
47
48
49
50
51
52
53
54
param (
[string]$buildVersion,
[string]$packageSuffix = "0",
[bool]$isLocal = $false,
[bool]$isPr = $false,
[string]$outputDirectory = (Join-Path -Path $PSScriptRoot -ChildPath "buildoutput"),
[bool]$forceArtifacts = $false,
[bool]$skipAssemblySigning = $false
)
if ($null -eq $buildVersion) {
throw "Parameter $buildVersion cannot be null or empty. Exiting script."
}
if ($isLocal){
$packageSuffix = "dev" + [datetime]::UtcNow.Ticks.ToString()
Write-Host "Local build - setting package suffixes to $packageSuffix" -ForegroundColor Yellow
}
dotnet --version
dotnet build Webjobs.sln -v q
if (-not $?) { exit 1 }
$projects =
"src\Microsoft.Azure.WebJobs\WebJobs.csproj",
"src\Microsoft.Azure.WebJobs.Host\WebJobs.Host.csproj",
"src\Microsoft.Azure.WebJobs.Host\WebJobs.Host.Sources.csproj",
"src\Microsoft.Azure.WebJobs.Logging\WebJobs.Logging.csproj",
"src\Microsoft.Azure.WebJobs.Logging.ApplicationInsights\WebJobs.Logging.ApplicationInsights.csproj",
"src\Microsoft.Azure.WebJobs.Host.Storage\WebJobs.Host.Storage.csproj",
"src\Microsoft.Azure.WebJobs.Rpc.Core\WebJobs.Rpc.Core.csproj",
"src\Microsoft.Azure.WebJobs.Extensions.Rpc\WebJobs.Extensions.Rpc.csproj",
"test\Microsoft.Azure.WebJobs.Host.TestCommon\WebJobs.Host.TestCommon.csproj"
foreach ($project in $projects)
{
$cmd = "pack", "$project", "-o", $outputDirectory, "--no-build"
if ($packageSuffix -ne "0")
{
$cmd += "--version-suffix", "-$packageSuffix"
}
& { dotnet $cmd }
if (-not $?) { exit 1 }
}
### Sign package if build is not a PR
if ((-not $isPr -and -not $isLocal) -or $forceArtifacts) {
& { .\tools\RunSigningJob.ps1 -isPr $isPr -artifactDirectory $outputDirectory -buildVersion $buildVersion -forceArtifacts $forceArtifacts -skipAssemblySigning $skipAssemblySigning}
if (-not $?) { exit 1 }
}