Skip to content

Commit

Permalink
Reuse more templates in our build (#101197)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Köplinger <[email protected]>
  • Loading branch information
jkoritzinsky and akoeplinger authored Apr 19, 2024
1 parent 94e8cda commit b067ce0
Show file tree
Hide file tree
Showing 8 changed files with 197 additions and 320 deletions.
4 changes: 4 additions & 0 deletions eng/pipelines/common/global-build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ parameters:
extraVariablesTemplates: []
preBuildSteps: []
templatePath: 'templates'
templateContext: ''

jobs:
- template: /eng/common/${{ parameters.templatePath }}/job/job.yml
Expand All @@ -51,6 +52,9 @@ jobs:
enablePublishTestResults: ${{ parameters.enablePublishTestResults }}
testResultsFormat: ${{ parameters.testResultsFormat }}

${{ if ne(parameters.templateContext, '') }}:
templateContext: ${{ parameters.templateContext }}

artifacts:
publish:
logs:
Expand Down
17 changes: 0 additions & 17 deletions eng/pipelines/common/templates/publish-pipeline-artifacts.yml

This file was deleted.

88 changes: 0 additions & 88 deletions eng/pipelines/mono/templates/generate-offsets.yml

This file was deleted.

117 changes: 0 additions & 117 deletions eng/pipelines/mono/templates/workloads-build.yml

This file was deleted.

119 changes: 54 additions & 65 deletions eng/pipelines/official/jobs/prepare-signed-artifacts.yml
Original file line number Diff line number Diff line change
@@ -1,76 +1,65 @@
parameters:
dependsOn: []
PublishRidAgnosticPackagesFromPlatform: ''
isOfficialBuild: false
logArtifactName: 'Logs-PrepareSignedArtifacts_Attempt$(System.JobAttempt)'

jobs:
- job: PrepareSignedArtifacts
displayName: Prepare Signed Artifacts
dependsOn: ${{ parameters.dependsOn }}
pool:
name: $(DncEngInternalBuildPool)
demands: ImageOverride -equals 1es-windows-2022
# Double the default timeout.
timeoutInMinutes: 240
workspace:
clean: all
- template: /eng/common/templates-official/job/job.yml
parameters:
name: 'PrepareSignedArtifacts'
displayName: 'Prepare Signed Artifacts'

variables:
- name: SignType
value: $[ coalesce(variables.OfficialSignType, 'real') ]
pool:
name: $(DncEngInternalBuildPool)
demands: ImageOverride -equals 1es-windows-2022

templateContext:
outputs:
- output: pipelineArtifact
displayName: 'Publish BuildLogs'
condition: succeededOrFailed()
targetPath: '$(Build.StagingDirectory)\BuildLogs'
artifactName: ${{ parameters.logArtifactName }}
# Double the default timeout.
timeoutInMinutes: 240

steps:
- checkout: self
clean: true
fetchDepth: 20
workspace:
clean: all

- ${{ if eq(parameters.isOfficialBuild, true) }}:
- task: NuGetAuthenticate@1
enableMicrobuild: true

- 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'))

- task: DownloadBuildArtifacts@0
displayName: Download IntermediateArtifacts
inputs:
artifactName: IntermediateArtifacts
downloadPath: $(Build.SourcesDirectory)\artifacts\PackageDownload
checkDownloadedFiles: true

- script: >-
build.cmd -ci
-subset publish
-configuration Release
/p:PublishRidAgnosticPackagesFromPlatform=${{ parameters.PublishRidAgnosticPackagesFromPlatform }}
/p:OfficialBuildId=$(Build.BuildNumber)
/p:SignType=$(SignType)
/p:DotNetSignType=$(SignType)
/bl:$(Build.SourcesDirectory)\prepare-artifacts.binlog
displayName: Prepare artifacts and upload to build
- task: CopyFiles@2
displayName: Copy Files to $(Build.StagingDirectory)\BuildLogs
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: |
**/*.log
**/*.binlog
TargetFolder: '$(Build.StagingDirectory)\BuildLogs'
continueOnError: true
condition: succeededOrFailed()
variables:
- name: '_SignType'
value: $[ coalesce(variables.OfficialSignType, 'real') ]

templateContext:
inputs:
- input: checkout
repository: self
clean: true
fetchDepth: 20
- input: pipelineArtifact
artifactName: IntermediateArtifacts
targetPath: $(Build.SourcesDirectory)\artifacts\PackageDownload
outputs:
- output: pipelineArtifact
displayName: 'Publish BuildLogs'
condition: succeededOrFailed()
targetPath: '$(Build.StagingDirectory)\BuildLogs'
artifactName: ${{ parameters.logArtifactName }}

steps:
- script: >-
build.cmd -ci
-subset publish
-configuration Release
/p:PublishRidAgnosticPackagesFromPlatform=${{ parameters.PublishRidAgnosticPackagesFromPlatform }}
/p:OfficialBuildId=$(Build.BuildNumber)
/p:SignType=$(_SignType)
/p:DotNetSignType=$(_SignType)
/bl:$(Build.SourcesDirectory)\prepare-artifacts.binlog
displayName: Prepare artifacts and upload to build
- task: CopyFiles@2
displayName: Copy Files to $(Build.StagingDirectory)\BuildLogs
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: |
**/*.log
**/*.binlog
TargetFolder: '$(Build.StagingDirectory)\BuildLogs'
continueOnError: true
condition: succeededOrFailed()
Loading

0 comments on commit b067ce0

Please sign in to comment.