Skip to content

Commit

Permalink
Add official build support to standalone templates (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
safern authored Oct 22, 2020
1 parent 0809d81 commit b1095c5
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 52 deletions.
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
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 }}
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

0 comments on commit b1095c5

Please sign in to comment.