diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d1b61769d31..0a6cdbc44d4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -8,21 +8,6 @@ variables: # clean the local repo on the build agents Build.Repository.Clean: true - - # Set some variables based on build conditions - ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}: - _HelixType: build/product - _HelixSource: pr/dotnet/wpf/$(Build.SourceBranch) - _PublishType: none - _SignType: test - _DotNetPublishToBlobFeed: false - # else - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - _TeamName: DotNetCore - _HelixSource: official/dotnet/wpf/$(Build.SourceBranch) - _PublishType: blob - _SignType: real - _DotNetPublishToBlobFeed: true # only trigger ci builds for the master branch trigger: @@ -34,7 +19,7 @@ trigger: # - master # Call the pipeline.yml template, which does the real work -phases: +jobs: - template: /eng/pipeline.yml parameters: ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: diff --git a/eng/build.yml b/eng/build.yml deleted file mode 100644 index 199026d4d11..00000000000 --- a/eng/build.yml +++ /dev/null @@ -1,90 +0,0 @@ -parameters: - name: '' - # send telemetry - enableTelemetry: true - # install Microbuild plugin if not a public build - enableMicrobuild: true - # queue YAML object - https://github.com/Microsoft/vsts-agent/blob/master/docs/preview/yamlgettingstarted-schema.md#queue - queue: {} - # variables YAML object - https://github.com/Microsoft/vsts-agent/blob/master/docs/preview/yamlgettingstarted-schema.md#phase - variables: {} - # run this build as a public build, even in the internal project - runAsPublic: false - -# Common conditionals: There are a number of common conditionals that are useful. Generally these are used to decide what resources can be accessed, -# or what logic should be applied based on the context the build is being run in. -# - eq/ne(variables['Agent.Os'], 'Windows_NT') - Running/not running on a windows machine -# - eq/ne(variables['System.TeamProject'], 'public') - Running/not running on the dotnet public VSTS project -# - and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest') - Not running in public and not a pull request. -# - or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest') - Running in public or a pull request. - -phases: -- template: /eng/common/templates/phases/base.yml - parameters: - enableTelemetry: ${{ parameters.enableTelemetry }} - - enableMicrobuild: ${{ parameters.enableMicrobuild }} - - name: ${{ parameters.name }} - - queue: ${{ parameters.queue }} - - runAsPublic: ${{ parameters.runAsPublic }} - - variables: - ${{ insert }}: ${{ parameters.variables }} - _HelixBuildConfig: $(_BuildConfig) - # Only enable publishing in non-public, non PR scenarios. - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - # This should be changed to an isolated blob feed per-build. - # Right now a manual build of a random branch would get published alongside the normal branch artifacts. - _PublishBlobFeedUrl: https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json - _SignArgs: /p:DotNetSignType=$(_SignType) /p:TeamName=$(_TeamName) - _PublishArgs: /p:DotNetPublishBlobFeedKey=$(dotnetfeed-storage-access-key-1) - /p:DotNetPublishBlobFeedUrl=$(_PublishBlobFeedUrl) - /p:DotNetPublishToBlobFeed=$(_DotNetPublishToBlobFeed) - /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) - /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) - _OfficialBuildIdArgs: /p:OfficialBuildId=$(BUILD.BUILDNUMBER) - # else - ${{ if or(eq(parameters.runAsPublic, 'true'), eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}: - _PublishArgs: '' - _OfficialBuildIdArgs: '' - _SignArgs: '' - - steps: - - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - task: AzureKeyVault@1 - inputs: - azureSubscription: 'DotNet-Engineering-Services_KeyVault' - KeyVaultName: EngKeyVault - SecretsFilter: 'dotnetfeed-storage-access-key-1,microsoft-symbol-server-pat,symweb-symbol-server-pat' - - # Use utility script to run script command dependent on agent OS. - - script: eng\common\cibuild.cmd - -configuration $(_BuildConfig) - -prepareMachine - $(_PublishArgs) - $(_SignArgs) - $(_OfficialBuildIdArgs) - /p:Platform=$(_Platform) - displayName: Windows Build / Publish - condition: and(succeeded(), eq(variables['Agent.Os'], 'Windows_NT')) - - - task: PublishBuildArtifacts@1 - displayName: Publish Logs to VSTS - inputs: - PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)' - PublishLocation: Container - ArtifactName: $(Agent.Os)_$(Agent.JobName) - continueOnError: true - condition: always() - - - task: PublishTestResults@2 - displayName: Publish Test Results - inputs: - testResultsFormat: 'xUnit' - testResultsFiles: '*.xml' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)' - continueOnError: true - condition: always() \ No newline at end of file diff --git a/eng/pipeline.yml b/eng/pipeline.yml index e42f3c79168..2b45dcb56d8 100644 --- a/eng/pipeline.yml +++ b/eng/pipeline.yml @@ -8,42 +8,83 @@ parameters: # Defaults to true runAsPublic: true -# Call build.yml, which runs common build tasks -phases: -- template: /eng/build.yml +jobs: +- template: /eng/common/templates/jobs/jobs.yml parameters: - name: Windows_NT - runAsPublic: ${{ parameters.runAsPublic }} - queue: - name: ${{ parameters.agentPool }} - parallel: 99 - matrix: - Build_Debug_x86: - _BuildConfig: Debug - # overwrite some values when building debug - _PublishType: none - _SignType: test - _DotNetPublishToBlobFeed : false - _Platform: x86 - Build_Debug_x64: - _BuildConfig: Debug - # overwrite some values when building debug - _PublishType: none - _SignType: test - _DotNetPublishToBlobFeed : false - _Platform: x64 - Build_Release_x86: - _BuildConfig: Release - _Platform: x86 - Build_Release_x64: - _BuildConfig: Release - _Platform: x64 + enableMicrobuild: true + enablePublishBuildArtifacts: true + enablePublishTestResults: true + enablePublishBuildAssets: true + enableTelemetry: true + helixRepo: dotnet/wpf -# only publish build assets if we're running internally -- ${{ if eq(parameters.runAsPublic, 'false') }}: - - template: /eng/common/templates/phases/publish-build-assets.yml - parameters: - dependsOn: Windows_NT - queue: - name: Hosted VS2017 - configuration: Debug \ No newline at end of file + jobs: + - job: Windows_NT + pool: ${{ parameters.agentPool }} + variables: + # needed for signing + - name: _TeamName + value: DotNetCore + - name: _SignType + value: test + - name: _SignArgs + value: '' + + # needed for darc (dependency flow) publishing + - name: _PublishType + value: none + - name: _DotNetPublishToBlobFeed + value: false + - name: _PublishArgs + value: '' + - name: _OfficialBuildIdArgs + value: '' + + # Override some values if we're building internally + - ${{ if eq(parameters.runAsPublic, 'false') }}: + # note: You have to use list syntax here (- name: value) or you will get errors about declaring the same variable multiple times + - name: _PublishType + value: blob + - name: _SignType + value: real + - name: _DotNetPublishToBlobFeed + value: true + - group: DotNet-Blob-Feed + - group: DotNet-Symbol-Server-Pats + - name: _PublishBlobFeedUrl + value: https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json + + # note: Even though they are referenced here, user defined variables (like $(_SignType)) are not resolved + # until the agent is running on the machine. They can be overridden any time before they are resolved, + # like in the job matrix below (see Build_Debug) + - name: _SignArgs + value: /p:DotNetSignType=$(_SignType) /p:TeamName=$(_TeamName) + - name: _PublishArgs + value: /p:DotNetPublishBlobFeedKey=$(dotnetfeed-storage-access-key-1) + /p:DotNetPublishBlobFeedUrl=$(_PublishBlobFeedUrl) + /p:DotNetPublishToBlobFeed=$(_DotNetPublishToBlobFeed) + /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) + /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) + - name: _OfficialBuildIdArgs + value: /p:OfficialBuildId=$(BUILD.BUILDNUMBER) + strategy: + matrix: + Build_Debug: + _BuildConfig: Debug + # override some variables for debug + _PublishType: none + _SignType: test + _DotNetPublishToBlobFeed : false + Build_Release: + _BuildConfig: Release + steps: + - checkout: self + clean: true + # Use utility script to run script command dependent on agent OS. + - script: eng\common\cibuild.cmd + -configuration $(_BuildConfig) + -prepareMachine + $(_PublishArgs) + $(_SignArgs) + $(_OfficialBuildIdArgs) + displayName: Windows Build / Publish \ No newline at end of file