forked from unoplatform/Uno.Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vsts-ci.yml
62 lines (43 loc) · 2.2 KB
/
.vsts-ci.yml
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
55
56
57
58
59
60
61
62
jobs:
- job: VS_Latest
timeoutInMinutes: 600
pool:
vmImage: windows-2022
steps:
- checkout: self
clean: true
- ${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/canaries') }}:
- template: .vsts-ci.canaries.yml
# Restore nuget.org to the list of existing sources, .NET 6 Pre 2 may somehow remove it
- powershell: |
dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org | Out-Null
$global:LASTEXITCODE = 0
displayName: Adjust nuget.org source
- template: build/templates/dotnet-install-windows.yml
- powershell: |
& choco install vswhere
$msbuildpath=(vswhere -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe -nologo)
echo "##vso[task.setvariable variable=msbuildpath]$msbuildpath"
displayName: Set MSBUILDPATH
- powershell: |
Set-PSDebug -Trace 1
$SolutionsToBuild = Get-ChildItem -Path **\*.sln -Recurse | Where-Object {$_.FullName -notmatch "\\ArchivedProjects\\"}
if($env:System_PullRequest_TargetBranch -eq $null) { $TargetBranch = "master" } else { $TargetBranch = $env:System_PullRequest_TargetBranch; }
foreach ($SolutionName in $SolutionsToBuild) {
$solutionPath=[System.IO.Path]::GetDirectoryName($SolutionName);
git diff --quiet HEAD "origin/$TargetBranch" -- "$solutionPath"
# Only build if there a change in the solution path for the current PR, if we're not in a PR
if( ("$env:System_PullRequest_PullRequestId" -eq '') -or ($global:LASTEXITCODE -ne 0)) {
echo "Building $solutionPath / $SolutionName"
& $env:msbuildpath $SolutionName /r /p:Configuration=Release /p:WasmShellMonoRuntimeExecutionMode=Interpreter /p:AotAssemblies=false /p:PublishTrimmed=false /p:WasmShellILLinkerEnabled=false /ds ;
if (($lastexitcode -ne 0)) {
exit $lastexitcode
}
# Clean the whole tree after every build to avoid disk space issues
git clean -fdx
}
}
displayName: Build samples
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)