This repository has been archived by the owner on Dec 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathazure-pipelines.yml
100 lines (95 loc) · 3.44 KB
/
azure-pipelines.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
93
94
95
96
97
98
99
100
trigger:
branches:
include:
- main
- refs/tags/*
resources:
repositories:
- repository: internal-templates
type: github
name: xamarin/yaml-templates
endpoint: xamarin
ref: refs/heads/main
- repository: 1esPipelines
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
parameters:
- name: Skip1ESComplianceTasks
default: false
- name: SignArtifacts
default: false
variables:
- group: Xamarin-Secrets
- name: Configuration
value: Release
- name: WindowsPoolImage1ESPT
value: 1ESPT-Windows2022
extends:
${{ if or(eq(variables['Build.Reason'], 'PullRequest'), eq('${{ parameters.Skip1ESComplianceTasks }}', 'true')) }}:
template: v1/1ES.Unofficial.PipelineTemplate.yml@1esPipelines
${{ else }}:
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
parameters:
sdl:
${{ if eq('${{ parameters.Skip1ESComplianceTasks }}', 'true') }}:
enableAllTools: false
binskim:
scanOutputDirectoryOnly: true
codeql:
runSourceLanguagesInSourceAnalysis: true
sourceAnalysisPool:
name: AzurePipelines-EO
image: $(WindowsPoolImage1ESPT)
os: windows
stages:
- stage: Build
jobs:
- job: buildWindows
pool:
name: AzurePipelines-EO
image: $(WindowsPoolImage1ESPT)
os: windows
variables:
LogDirectory: $(Build.ArtifactStagingDirectory)\logs
Codeql.Enabled: true
templateContext:
outputs:
- output: pipelineArtifact
displayName: upload artifacts
artifactName: nuget
targetPath: $(Build.ArtifactStagingDirectory)
steps:
- powershell: |
& dotnet build Xamarin.Build.AsyncTask\Xamarin.Build.AsyncTask.csproj -c Debug -bl:$(LogDirectory)\Debug.binlog
& dotnet build Xamarin.Build.AsyncTask\Xamarin.Build.AsyncTask.csproj -c Release -bl:$(LogDirectory)\Release.binlog
displayName: build libraries
errorActionPreference: stop
- powershell: |
& dotnet build Xamarin.Build.AsyncTask\Xamarin.Build.AsyncTask.csproj -c Release -t:Test -bl:$(LogDirectory)\Test.binlog
displayName: test libraries
errorActionPreference: stop
- powershell: |
& dotnet pack Xamarin.Build.AsyncTask\Xamarin.Build.AsyncTask.csproj -c Release -bl:$(LogDirectory)\PackRelease.binlog
displayName: pack NuGet
errorActionPreference: stop
- task: CopyFiles@2
displayName: Copy nupkg
inputs:
contents: '**/*.*nupkg'
targetFolder: $(Build.ArtifactStagingDirectory)
- task: CopyFiles@2
displayName: Copy SignList
inputs:
contents: 'SignList.xml'
targetFolder: $(Build.ArtifactStagingDirectory)
- stage: Sign
dependsOn: Build
condition: and(eq(dependencies.Build.result, 'Succeeded'), eq(variables['System.TeamProject'], 'devdiv'), or(startsWith(variables['Build.SourceBranch'], 'refs/tags/'), eq('${{ parameters.SignArtifacts }}', 'true'))) # only sign the packages when running on Windows, and using the private server which has the certificates
jobs:
- template: sign-artifacts/jobs/v2.yml@internal-templates
parameters:
signListPath: 'SignList.xml'
signType: Real
usePipelineArtifactTasks: true
use1ESTemplate: true