-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathazure-pipelines.yaml
More file actions
85 lines (73 loc) · 2.4 KB
/
azure-pipelines.yaml
File metadata and controls
85 lines (73 loc) · 2.4 KB
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
name: android-tools $(Rev:r)
trigger:
- main
- release/*
pr:
- main
- release/*
# Global variables
variables:
- name: DotNetCoreVersion
value: 10.0.x
jobs:
- job: build
displayName: Build and Test
timeoutInMinutes: 60
strategy:
matrix:
macOS:
vmImage: macOS-15
windows:
vmImage: windows-2022
pool:
vmImage: $(vmImage)
workspace:
clean: all
steps:
- checkout: self
clean: true
- task: UseDotNet@2
displayName: Use .NET Core $(DotNetCoreVersion)
inputs:
version: $(DotNetCoreVersion)
- task: DotNetCoreCLI@2
displayName: Build solution Xamarin.Android.Tools.sln
inputs:
projects: Xamarin.Android.Tools.sln
arguments: -bl:$(Build.ArtifactStagingDirectory)/build.binlog
- task: DotNetCoreCLI@2
displayName: Run Tests
inputs:
command: test
projects: bin/TestDebug/**/*-Tests.dll
- powershell: |
$hashOfLastVersionChange = & "git" "log" "--follow" "-1" "--pretty=%H" "nuget.version"
$commitsSinceVersionChange = & "git" "rev-list" "--count" "$hashOfLastVersionChange..HEAD"
$majorMinor = Get-Content "nuget.version"
$version = "$majorMinor.$commitsSinceVersionChange"
Write-Host "##vso[task.setvariable variable=xat.nuget.version]$version"
condition: and(succeeded(), eq(variables['agent.os'], 'Windows_NT'))
- task: DotNetCoreCLI@2
displayName: Build NuGet
inputs:
command: custom
projects: src/Xamarin.Android.Tools.AndroidSdk/Xamarin.Android.Tools.AndroidSdk.csproj
custom: pack
arguments: -p:Version=$(xat.nuget.version) -p:PackageOutputPath=$(Build.ArtifactStagingDirectory) -bl:$(Build.ArtifactStagingDirectory)/pack.binlog
condition: and(succeeded(), eq(variables['agent.os'], 'Windows_NT'))
- powershell: |
$suffix = if ($(System.JobAttempt) -gt 1) { " (Attempt $(System.JobAttempt))" } else { "" }
Write-Host "##vso[task.setvariable variable=ArtifactSuffix;]$suffix"
displayName: Set artifact suffix for retries
condition: always()
- task: PublishPipelineArtifact@1
displayName: Upload Build Output
inputs:
path: bin/Debug
artifactName: Output - $(System.JobName)$(ArtifactSuffix)
- task: PublishPipelineArtifact@1
displayName: Upload Artifacts
inputs:
path: $(Build.ArtifactStagingDirectory)
artifactName: Artifacts - $(System.JobName)$(ArtifactSuffix)
condition: always()