-
Notifications
You must be signed in to change notification settings - Fork 55
/
windows-build.yml
83 lines (75 loc) · 3.01 KB
/
windows-build.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
parameters:
additionalMSBuildArguments: ''
displayName: ''
publishRidAgnosticPackages: false
skipTests: $(SkipTests)
targetArchitecture: null
timeoutInMinutes: 120
disableVSPublish: false
jobs:
- job: ${{ parameters.name }}
displayName: ${{ parameters.name }}
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
pool:
# Use a hosted pool when possible.
${{ if eq(variables['System.TeamProject'], 'public') }}:
name: NetCorePublic-Pool
queue: buildpool.windows.10.amd64.vs2017.open
${{ if ne(variables['System.TeamProject'], 'public') }}:
name: NetCoreInternal-Pool
queue: buildpool.windows.10.amd64.vs2017
strategy:
matrix:
debug:
_BuildConfig: Debug
release:
_BuildConfig: Release
workspace:
clean: all
variables:
CommonMSBuildArgs: >-
/p:Configuration=$(_BuildConfig)
/p:OfficialBuildId=$(OfficialBuildId)
/p:TargetArchitecture=${{ parameters.targetArchitecture }}
/p:PortableBuild=true
/p:SkipTests=${{ parameters.skipTests }}
MsbuildSigningArguments: >-
/p:CertificateId=400
/p:DotNetSignType=$(SignType)
TargetArchitecture: ${{ parameters.targetArchitecture }}
DisableVSPublish: ${{ parameters.disableVSPublish }}
steps:
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- task: NuGetAuthenticate@0
- task: MicroBuildSigningPlugin@2
displayName: Install MicroBuild plugin for Signing
inputs:
signType: $(SignType)
zipSources: false
feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json
continueOnError: false
condition: and(succeeded(), in(variables['SignType'], 'real', 'test'))
# NuGet's http cache lasts 30 minutes. If we're on a static machine, this may interfere with
# auto-update PRs by preventing the CI build from fetching the new version. Delete the cache.
- powershell: Remove-Item -Recurse -ErrorAction Ignore "$env:LocalAppData\NuGet\v3-cache"
displayName: Clear NuGet http cache (if exists)
- script: >-
build.cmd -ci -test
$(CommonMSBuildArgs)
$(MsbuildSigningArguments)
displayName: Build
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- task: NuGetCommand@2
displayName: Push Visual Studio NuPkgs
inputs:
command: push
packagesToPush: '$(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)/*/VS.Redist.Common.*.nupkg'
nuGetFeedType: external
publishFeedCredentials: 'DevDiv - VS package feed'
condition: and(
succeeded(),
eq(variables['_BuildConfig'], 'Release'),
ne(variables['DisableVSPublish'], 'true'))
- template: steps/upload-job-artifacts.yml
parameters:
name: ${{ parameters.name }}