-
Notifications
You must be signed in to change notification settings - Fork 330
Expand file tree
/
Copy pathsqlclient-package.yml
More file actions
168 lines (145 loc) · 5.67 KB
/
Copy pathsqlclient-package.yml
File metadata and controls
168 lines (145 loc) · 5.67 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
#################################################################################
# Licensed to the .NET Foundation under one or more agreements. #
# The .NET Foundation licenses this file to you under the MIT license. #
# See the LICENSE file in the project root for more information. #
#################################################################################
# This pipeline builds all packages using the build.proj Pack target with ReferenceType=Package,
# then publishes the resulting .nupkg and .snupkg files as a single pipeline artifact.
#
# It runs:
# - On pushes to GitHub main and ADO internal/main (batched)
# - Nightly at 00:00 UTC on both branches
#
# On internal/main the strong-name signing key is downloaded and used to sign assemblies during the
# build.
#
# GOTCHA: This pipeline definition is triggered by GitHub _and_ ADO CI. We distinguish the two via
# branch filters:
#
# - Only the GitHub repo has a 'main' branch.
# - Only the ADO repo has an 'internal/main' branch.
name: $(DayOfYear)$(Rev:rr)
# Do not trigger this pipeline for PRs.
pr: none
# Trigger on pushes to main and internal/main, batching concurrent commits.
trigger:
batch: true
branches:
include:
- main
- internal/main
# Nightly schedule at 00:00 UTC.
schedules:
- cron: '0 0 * * *'
displayName: Nightly Build
branches:
include:
- main
- internal/main
always: true
# Pipeline parameters visible in the Azure DevOps UI.
parameters:
# The agent image to use for the build. This must exist in both the ADO-1ES-Pool and
# ADO-CI-1ES-Pool agent pools.
- name: agentImage
displayName: Agent Image
type: string
default: ADO-UB24
values:
- ADO-UB24
- ADO-Win25
# The build configuration to use, either Debug or Release.
- name: buildConfiguration
displayName: Build Configuration
type: string
default: Release
values:
- Debug
- Release
# True to enable debug steps and output.
- name: debug
displayName: Enable debug output
type: boolean
default: false
# The verbosity level of dotnet CLI commands.
- name: dotnetVerbosity
displayName: dotnet CLI Verbosity
type: string
default: normal
values:
- quiet
- minimal
- normal
- detailed
- diagnostic
variables:
# Whether this is an internal (ADO.Net project) or public (Public project) build.
- name: isInternalBuild
value: ${{ eq(variables['System.TeamProject'], 'ADO.Net') }}
# Signing key argument passed to build.proj. On internal builds this references the secure file
# downloaded by download-assembly-signing-key.yml; on public builds it expands to empty.
- name: signingKeyArg
${{ if eq(variables.isInternalBuild, true) }}:
value: '-p:SigningKeyPath="$(driverKeyFile.secureFilePath)"'
${{ else }}:
value: ''
jobs:
- job: pack_all_packages
displayName: Pack All Packages
pool:
${{ if eq(variables.isInternalBuild, true) }}:
name: ADO-1ES-Pool
${{ else }}:
name: ADO-CI-1ES-Pool
demands:
- ImageOverride -equals ${{ parameters.agentImage }}
steps:
# Emit environment variables if debug is enabled.
- ${{ if eq(parameters.debug, true) }}:
- pwsh: |
Get-ChildItem Env: | Sort-Object Name | Format-Table -AutoSize -Wrap
displayName: '[Debug] Print Environment Variables'
# Install the .NET SDK from global.json.
- template: /eng/pipelines/steps/install-dotnet.yml@self
parameters:
debug: ${{ parameters.debug }}
# Restore dotnet local tools (pwsh, apicompat, etc.).
- template: /eng/pipelines/steps/restore-dotnet-tools.yml@self
# Clean any pre-existing .nupkg / .snupkg files from the packages/ directory
# to ensure we only publish packages produced by this run.
- pwsh: |
Write-Host 'Cleaning packages/ directory...'
Remove-Item -Force "$(Build.SourcesDirectory)/packages/*.nupkg" -ErrorAction SilentlyContinue
Remove-Item -Force "$(Build.SourcesDirectory)/packages/*.snupkg" -ErrorAction SilentlyContinue
Write-Host 'Done.'
displayName: Clean packages/ directory
# On internal builds, download the assembly signing key.
- ${{ if eq(variables.isInternalBuild, true) }}:
- template: /eng/pipelines/common/steps/download-assembly-signing-key.yml@self
# Run the Pack target via build.proj.
- task: DotNetCoreCLI@2
displayName: build.proj - Pack (ReferenceType=Package)
inputs:
command: build
projects: '$(Build.SourcesDirectory)/build.proj'
arguments: >-
-t:Pack
-p:Configuration=${{ parameters.buildConfiguration }}
-p:ReferenceType=Package
-p:BuildNumber="$(Build.BuildNumber)"
-p:BuildSuffix=ci
$(signingKeyArg)
--verbosity ${{ parameters.dotnetVerbosity }}
# List produced packages for diagnostics.
- pwsh: |
Write-Host 'Packages produced:'
Get-ChildItem "$(Build.SourcesDirectory)/packages/*.nupkg" -ErrorAction SilentlyContinue | Format-Table Name, Length -AutoSize -Wrap
Get-ChildItem "$(Build.SourcesDirectory)/packages/*.snupkg" -ErrorAction SilentlyContinue | Format-Table Name, Length -AutoSize -Wrap
displayName: List produced packages
# Publish all .nupkg and .snupkg files from packages/ as a pipeline artifact.
- task: PublishPipelineArtifact@1
displayName: Publish NuGet Packages
inputs:
targetPath: '$(Build.SourcesDirectory)/packages'
artifactName: Packages
publishLocation: pipeline