-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathpackage-validation.yml
92 lines (75 loc) · 2.83 KB
/
package-validation.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
parameters:
- name: arguments
type: string
default: ''
- name: unocheckArguments
type: string
default: ''
steps:
- checkout: self
clean: 'true'
- powershell: |
$templateArgs = '${{ parameters.arguments }}'
Write-Host "TemplateArgs = '$templateArgs'"
$dotnetVersion = $env:TargetDotNetVersion
if ($templateArgs -match 'net9.0')
{
$dotnetVersion = '9.0.100-preview.2.24157.14'
}
Write-Host "DotNetVersion = $dotnetVersion"
Write-Output "##vso[task.setvariable variable=DotNetVersion]$dotnetVersion"
displayName: Evaluate Template Args
env:
TargetDotNetVersion: $(ValidationDotNetVersion)
- template: dotnet-install-windows.yml
parameters:
DotNetVersion: $(DotNetVersion)
- task: DownloadBuildArtifacts@0
inputs:
artifactName: $(Build.DefinitionName)
- script: |
md $(Build.SourcesDirectory)\src\PackageCache
copy "$(System.ArtifactsDirectory)\$(Build.DefinitionName)\*.nupkg" $(Build.SourcesDirectory)\src\PackageCache
displayName: Copy Artifacts to PackageCache
- script: dotnet new install "$(System.ArtifactsDirectory)\$(Build.DefinitionName)\Uno.Templates*.nupkg"
displayName: Install Project Templates
- powershell: |
dotnet nuget add source -n nuget_local $(Build.SourcesDirectory)\src\PackageCache
dotnet nuget add source -n uno_dev "https://pkgs.dev.azure.com/uno-platform/1dd81cbd-cb35-41de-a570-b0df3571a196/_packaging/unoplatformdev/nuget/v3/index.json"
dotnet nuget add source -n net8 "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json"
Set-PSDebug -Trace 1
$ErrorActionPreference = 'Stop'
# Create app with defaults
dotnet new unoapp -skip -d -v diagnostic -o UnoApp1 ${{ parameters.arguments }}
if ($LASTEXITCODE -ne 0)
{
throw "Exit code must be zero."
}
displayName: Create template app
- template: canary-updater.yml
parameters:
MergeBranch: false
- powershell: |
& dotnet tool install --global Uno.Check --version $env:ValidationUnoCheckVersion
cd UnoApp1
uno-check -v --ci --non-interactive --fix --skip xcode --skip gtk3 --skip vswin --skip androidemulator --skip androidsdk --skip vsmac --skip dotnetnewunotemplates ${{ parameters.unocheckArguments }}
displayName: Uno Check
env:
ValidationUnoCheckVersion: $(ValidationUnoCheckVersion)
- powershell: |
Set-PSDebug -Trace 1
$ErrorActionPreference = 'Stop'
cd UnoApp1
& dotnet build UnoApp1.sln "/bl:$(build.artifactstagingdirectory)\$(Agent.JobName).binlog"
if ($LASTEXITCODE -ne 0)
{
throw "Exit code must be zero."
}
displayName: Build template app
- task: PublishBuildArtifacts@1
condition: always()
retryCountOnTaskFailure: 3
inputs:
PathtoPublish: $(build.artifactstagingdirectory)
ArtifactName: logs
ArtifactType: Container