Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add official build support to standalone templates #261

Merged
merged 1 commit into from
Oct 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions eng/Publishing.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<PublishingVersion>3</PublishingVersion>
</PropertyGroup>
</Project>
47 changes: 34 additions & 13 deletions eng/pipelines/runtimelab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ pr:
- SECURITY.md
- THIRD-PARTY-NOTICES.TXT

variables:
- name: _TeamName
value: dotnet-core

stages:
- stage: build
displayName: Build
Expand All @@ -49,19 +53,36 @@ stages:
parameters:
osGroup: Windows_NT
archType: x64
pool:
vmImage: 'windows-latest'
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
isOfficialBuild: true
runTests: false
pool:
name: NetCoreInternal-Pool
queue: BuildPool.Windows.10.Amd64.VS2019
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
pool:
vmImage: 'windows-latest'

- template: /eng/pipelines/templates/build-job.yml
parameters:
osGroup: OSX
archType: x64
pool:
vmImage: 'macOS-latest'
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
- template: /eng/pipelines/templates/build-job.yml
parameters:
osGroup: OSX
archType: x64
pool:
vmImage: 'macOS-latest'

- template: /eng/pipelines/templates/build-job.yml
- template: /eng/pipelines/templates/build-job.yml
parameters:
osGroup: Linux
archType: x64
pool:
vmImage: 'ubuntu-latest'

# Publish and validation steps. Only run in official builds
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- template: \eng\common\templates\post-build\post-build.yml
parameters:
osGroup: Linux
archType: x64
pool:
vmImage: 'ubuntu-latest'
publishingInfraVersion: 3
validateDependsOn:
- build
enableSourceLinkValidation: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also enable validation/publishing of symbols or does that happen automatically?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

publishing of symbols is already happening. Validation I didn't enable it because I remember there was problems with it due to a delay in the symbol server when you publish new symbols. @riarenas @epananth is that still the case?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@safern yes, I believe that's still the case.

102 changes: 63 additions & 39 deletions eng/pipelines/templates/build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,74 @@ parameters:
archType: ''
container: ''
pool: {}
isOfficialBuild: ''
isOfficialBuild: false
runTests: true

jobs:

- template: /eng/common/templates/job/job.yml
- template: /eng/common/templates/jobs/jobs.yml
parameters:
displayName: ${{ format('{0} {1}', parameters.osGroup, parameters.archType) }}
name: ${{ format('{0}_{1}', parameters.osGroup, parameters.archType) }}
enableTelemetry: ${{ parameters.isOfficialBuild }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I must be missing it but where were we passing isOfficialBuild before? Looks like we were just not passing it and always defaulting to empty here right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I saw that. I meant before this change, we seem to have been using it to set the enableTelemetry field but we weren't actually setting it on the main yml or importing it unless I'm missing something.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see what you're saying. The arcade templates ignore true if it is in an official build.

enableTelemetry: true
helixRepo: dotnet/runtimelab
pool: ${{ parameters.pool }}
enablePublishBuildArtifacts: true
strategy:
matrix:
Release:
_BuildConfig: Release
Debug:
_BuildConfig: Debug

${{ if eq(parameters.runTests, true) }}:
testResultsFormat: vstest
testRunTitle: ${{ parameters.osGroup }}_${{ parameters.archType }}_$(_BuildConfig)

${{ if ne(parameters.container, '') }}:
${{ if eq(parameters.container.registry, 'mcr') }}:
container: ${{ format('{0}:{1}', 'mcr.microsoft.com/dotnet-buildtools/prereqs', parameters.container.image) }}
${{ if ne(parameters.container.registry, 'mcr') }}:
container: ${{ format('{0}:{1}', parameters.container.registry, parameters.container.image) }}

variables:
- _buildScript: build.cmd

- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
- _buildScript: ./build.sh

- _testBuildArg: ''
- ${{ if eq(parameters.runTests, true) }}:
- _testBuildArg: -test

steps:
- script: $(_buildScript)
-ci
$(_testBuildArg)
-c $(_BuildConfig)
/p:TargetPlatform=${{ parameters.archType }}
displayName: Build and Test
enablePublishBuildAssets: true
enablePublishUsingPipelines: true
enableMicrobuild: true
graphFileGeneration:
enabled: false
includeToolset: false

jobs:
- job: ${{ format('{0}_{1}', parameters.osGroup, parameters.archType) }}
displayName: ${{ format('{0} {1}', parameters.osGroup, parameters.archType) }}
strategy:
matrix:
Release:
_BuildConfig: Release
${{ if eq(parameters.isOfficialBuild, false) }}:
Debug:
_BuildConfig: Debug

${{ if eq(parameters.runTests, true) }}:
testResultsFormat: vstest
testRunTitle: ${{ parameters.osGroup }}_${{ parameters.archType }}_$(_BuildConfig)

${{ if ne(parameters.container, '') }}:
${{ if eq(parameters.container.registry, 'mcr') }}:
container: ${{ format('{0}:{1}', 'mcr.microsoft.com/dotnet-buildtools/prereqs', parameters.container.image) }}
${{ if ne(parameters.container.registry, 'mcr') }}:
container: ${{ format('{0}:{1}', parameters.container.registry, parameters.container.image) }}

variables:
- _buildScript: build.cmd

- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
- _buildScript: ./build.sh

- _testBuildArg: ''
- ${{ if eq(parameters.runTests, true) }}:
- _testBuildArg: -test

- _officialBuildArgs: ''
- ${{ if eq(parameters.isOfficialBuild, true) }}:
- group: DotNet-Symbol-Server-Pats
- _SignType: real
- _officialBuildArgs: -sign
-publish
/p:DotNetSignType=$(_SignType)
/p:TeamName=$(_TeamName)
/p:OfficialBuildId=$(Build.BuildNumber)
/p:DotNetPublishUsingPipelines=true
/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)

steps:
- script: $(_buildScript)
-ci
-pack
-c $(_BuildConfig)
$(_testBuildArg)
$(_officialBuildArgs)
/p:TargetPlatform=${{ parameters.archType }}
displayName: Build and Test