1
- resources :
2
- - repo : self
3
- clean : true
4
- queue :
5
- name : VSEng-MicroBuildVS2017
6
- demands : Cmd
7
1
variables :
8
- BuildConfiguration : Release
9
- TeamName : Roslyn
2
+ - name : _TeamName
3
+ value : DotNetCore
10
4
11
- steps :
12
- - task : ms-vseng.MicroBuildTasks.30666190-6959-11e5-9f96-f56098202fef.MicroBuildSigningPlugin@1
13
- displayName : Install Signing Plugin
14
- inputs :
15
- signType : real
16
- esrpSigning : true
17
- condition : and(succeeded(), eq(variables['PB_SignType'], 'real'))
5
+ # CI and PR triggers
6
+ trigger :
7
+ batch : true
8
+ branches :
9
+ include :
10
+ - master
18
11
19
- - task : BatchScript@1
20
- displayName : Build
21
- inputs :
22
- filename : ' build\cibuild.cmd '
23
- arguments : ' -configuration $(BuildConfiguration) /p:PB_PublishBlobFeedKey=$(PB_PublishBlobFeedKey) '
12
+ pr :
13
+ autoCancel : false
14
+ branches :
15
+ include :
16
+ - ' * '
24
17
25
- - task : PublishTestResults@2
26
- displayName : Publish Test Results
27
- inputs :
28
- testRunner : XUnit
29
- testResultsFiles : ' artifacts/$(BuildConfiguration)/TestResults/*.xml'
30
- mergeTestResults : true
31
- testRunTitle : ' Unit Tests'
32
- condition : and(succeededOrFailed(), ne(variables['PB_SkipTests'], 'true'))
18
+ jobs :
19
+ - template : /eng/common/templates/jobs/jobs.yml
20
+ parameters :
21
+ enableMicrobuild : true
22
+ enablePublishBuildArtifacts : true
23
+ enablePublishTestResults : true
24
+ enablePublishBuildAssets : true
25
+ enableTelemetry : true
26
+ helixRepo : dotnet/command-line-api
27
+ timeoutInMinutes : 180 # increase timeout since BAR publishing might wait a long time
28
+ jobs :
29
+ - job : Windows
30
+ pool :
31
+ # For public or PR jobs, use the hosted pool. For internal jobs use the internal pool.
32
+ # Will eventually change this to two BYOC pools.
33
+ ${{ if ne(variables['System.TeamProject'], 'internal') }} :
34
+ name : dotnet-external-temp
35
+ ${{ if eq(variables['System.TeamProject'], 'internal') }} :
36
+ name : dotnet-internal-temp
37
+ variables :
38
+ # Only enable publishing in official builds.
39
+ - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }} :
40
+ # DotNet-Blob-Feed provides: dotnetfeed-storage-access-key-1
41
+ # Publish-Build-Assets provides: MaestroAccessToken, BotAccount-dotnet-maestro-bot-PAT
42
+ - group : DotNet-Blob-Feed
43
+ - group : Publish-Build-Assets
44
+ - name : _OfficialBuildArgs
45
+ value : /p:DotNetSignType=$(_SignType)
46
+ /p:TeamName=$(_TeamName)
47
+ /p:DotNetPublishBlobFeedKey=$(dotnetfeed-storage-access-key-1)
48
+ /p:DotNetPublishBlobFeedUrl=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json
49
+ /p:DotNetPublishToBlobFeed=$(_DotNetPublishToBlobFeed)
50
+ /p:OfficialBuildId=$(BUILD.BUILDNUMBER)
51
+ # else
52
+ - ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }} :
53
+ - name : _OfficialBuildArgs
54
+ value : ' '
55
+ strategy :
56
+ matrix :
57
+ ${{ if in(variables['Build.Reason'], 'PullRequest') }} :
58
+ Debug :
59
+ _BuildConfig : Debug
60
+ _SignType : test
61
+ _DotNetPublishToBlobFeed : false
62
+ _BuildArgs :
33
63
34
- - task : NuGetCommand@2
35
- displayName : Publish NuGet Packages to MyGet
36
- inputs :
37
- command : push
38
- packagesToPush : ' artifacts\$(BuildConfiguration)\packages\*.nupkg'
39
- nuGetFeedType : external
40
- publishFeedCredentials : ' dotnet.myget.org/system-commandline'
41
- condition : and(succeeded(), not(contains(variables['PB_PublishType'], 'blob')))
64
+ Release :
65
+ _BuildConfig : Release
66
+ # PRs or external builds are not signed.
67
+ ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }} :
68
+ _SignType : test
69
+ _DotNetPublishToBlobFeed : false
70
+ ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }} :
71
+ _SignType : real
72
+ _DotNetPublishToBlobFeed : true
73
+ _BuildArgs : $(_OfficialBuildArgs)
74
+ steps :
75
+ - checkout : self
76
+ clean : true
77
+ - script : eng\common\cibuild.cmd
78
+ -configuration $(_BuildConfig)
79
+ -prepareMachine
80
+ $(_BuildArgs)
81
+ displayName : Build and Publish
82
+ - task : PublishBuildArtifacts@1
83
+ displayName : Upload package artifacts
84
+ condition : and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release'))
85
+ inputs :
86
+ pathtoPublish : artifacts/packages/
87
+ artifactName : artifacts
88
+ artifactType : Container
89
+ parallel : true
42
90
43
- - task : CopyPublishBuildArtifacts@1
44
- displayName : Publish Artifacts
45
- inputs :
46
- CopyRoot : ' $(Build.SourcesDirectory)'
47
- Contents : |
48
- artifacts\$(BuildConfiguration)\bin
49
- artifacts\$(BuildConfiguration)\log
50
- artifacts\$(BuildConfiguration)\TestResults
51
- artifacts\$(BuildConfiguration)\packages
52
- ArtifactName : ' $(Build.BuildNumber)'
53
- ArtifactType : FilePath
54
- TargetPath : ' $(DropRoot)\$(TeamName)\$(Build.DefinitionName)'
55
- condition : and(succeededOrFailed(), not(contains(variables['PB_PublishType'], 'blob')))
91
+ - job : Ubuntu_16_04
92
+ displayName : ' Ubuntu 16.04'
93
+ pool :
94
+ name : Hosted Ubuntu 1604
95
+ vmImage : ubuntu-16.04
96
+ strategy :
97
+ matrix :
98
+ ${{ if in(variables['Build.Reason'], 'PullRequest') }} :
99
+ Debug :
100
+ _BuildConfig : Debug
101
+ _SignType : none
102
+ _DotNetPublishToBlobFeed : false
103
+ Release :
104
+ _BuildConfig : Release
105
+ _SignType : none
106
+ _DotNetPublishToBlobFeed : false
107
+ steps :
108
+ - checkout : self
109
+ clean : true
110
+ - script : eng/common/cibuild.sh
111
+ --configuration $(_BuildConfig)
112
+ --prepareMachine
113
+ displayName : Build
56
114
57
- - task : ms-vseng.MicroBuildTasks.521a94ea-9e68-468a-8167-6dcf361ea776.MicroBuildCleanup@1
58
- displayName : Cleanup
59
- condition : succeededOrFailed()
60
-
61
- - task : PublishBuildArtifacts@1
62
- displayName : Publish MicroBuild Artifacts
63
- inputs :
64
- PathtoPublish : ' $(Build.ArtifactStagingDirectory)\MicroBuild\Output'
65
- ArtifactName : ' $(Build.BuildNumber)'
66
- publishLocation : FilePath
67
- TargetPath : ' $(DropRoot)\$(TeamName)\$(Build.DefinitionName)'
68
- condition : and(succeededOrFailed(), not(contains(variables['PB_PublishType'], 'blob')))
115
+ - job : OSX_10_13
116
+ displayName : ' OSX'
117
+ pool :
118
+ name : Hosted macOS
119
+ vmImage : macOS-10.13
120
+ strategy :
121
+ matrix :
122
+ ${{ if in(variables['Build.Reason'], 'PullRequest') }} :
123
+ Debug :
124
+ _BuildConfig : Debug
125
+ _SignType : none
126
+ _DotNetPublishToBlobFeed : false
127
+ Release :
128
+ _BuildConfig : Release
129
+ _SignType : none
130
+ _DotNetPublishToBlobFeed : false
131
+ steps :
132
+ - checkout : self
133
+ clean : true
134
+ - script : eng/common/cibuild.sh
135
+ --configuration $(_BuildConfig)
136
+ --prepareMachine
137
+ displayName : Build
0 commit comments