Convert CI pipeline to MicroBuild template
This commit is contained in:
Родитель
cc916064eb
Коммит
711b2642d9
61
.vsts-ci.yml
61
.vsts-ci.yml
|
@ -13,32 +13,45 @@ trigger:
|
|||
|
||||
pr: none
|
||||
|
||||
queue:
|
||||
name: VSEngSS-MicroBuild2019-1ES
|
||||
timeoutInMinutes: 120
|
||||
demands:
|
||||
- MSBuild
|
||||
- VisualStudio
|
||||
- VSTest
|
||||
pool: VSEngSS-MicroBuild2022-1ES
|
||||
|
||||
steps:
|
||||
- task: ms-vseng.MicroBuildTasks.30666190-6959-11e5-9f96-f56098202fef.MicroBuildSigningPlugin@1
|
||||
displayName: Install MicroBuild signing plugin
|
||||
inputs:
|
||||
esrpSigning: true
|
||||
signType: $(SignType)
|
||||
resources:
|
||||
repositories:
|
||||
- repository: MicroBuildTemplate
|
||||
type: git
|
||||
name: 1ESPipelineTemplates/MicroBuildTemplate
|
||||
ref: refs/tags/release
|
||||
|
||||
- template: build/build.yml
|
||||
extends:
|
||||
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
|
||||
parameters:
|
||||
BuildConfiguration: $(BuildConfiguration)
|
||||
BuildPlatform: $(BuildPlatform)
|
||||
Sign: true
|
||||
pool:
|
||||
name: VSEngSS-MicroBuild2022-1ES
|
||||
sdl:
|
||||
policheck:
|
||||
enabled: true
|
||||
binskim:
|
||||
enabled: true
|
||||
scanOutputDirectoryOnly: true
|
||||
|
||||
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
||||
displayName: Detect components
|
||||
inputs:
|
||||
sourceScanPath: $(Build.SourcesDirectory)
|
||||
stages:
|
||||
- stage: Build
|
||||
jobs:
|
||||
- job: Build
|
||||
templateContext:
|
||||
mb:
|
||||
signing:
|
||||
enabled: true
|
||||
signType: $(SignType)
|
||||
zipSources: false
|
||||
steps:
|
||||
- template: /build/build.yml@self
|
||||
parameters:
|
||||
BuildConfiguration: $(BuildConfiguration)
|
||||
BuildPlatform: $(BuildPlatform)
|
||||
Sign: true
|
||||
PublishArtifactTemplate: /build/templates/1es-publish-task.yml@self
|
||||
|
||||
- task: ms-vseng.MicroBuildTasks.521a94ea-9e68-468a-8167-6dcf361ea776.MicroBuildCleanup@1
|
||||
displayName: Clean up
|
||||
condition: succeededOrFailed()
|
||||
- task: ms-vseng.MicroBuildTasks.521a94ea-9e68-468a-8167-6dcf361ea776.MicroBuildCleanup@1
|
||||
displayName: Clean up
|
||||
condition: succeededOrFailed()
|
||||
|
|
|
@ -13,11 +13,12 @@ pr:
|
|||
- README.md
|
||||
|
||||
pool:
|
||||
vmImage: windows-2019
|
||||
vmImage: windows-2022
|
||||
|
||||
steps:
|
||||
- template: build/build.yml
|
||||
- template: /build/build.yml@self
|
||||
parameters:
|
||||
BuildConfiguration: $(BuildConfiguration)
|
||||
BuildPlatform: $(BuildPlatform)
|
||||
Docker: true
|
||||
PublishArtifactTemplate: /build/templates/ado-publish-task.yml@self
|
||||
|
|
|
@ -6,6 +6,7 @@ parameters:
|
|||
BuildPlatform: Any CPU
|
||||
Docker: false
|
||||
Sign: false
|
||||
PublishArtifactTemplate: /build/templates/1es-publish-task.yml@self
|
||||
|
||||
steps:
|
||||
- pwsh: |
|
||||
|
@ -138,16 +139,14 @@ steps:
|
|||
Contents: bin\${{ parameters.BuildConfiguration }}\**
|
||||
TargetFolder: $(Build.ArtifactStagingDirectory)\drop
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: Publish drop
|
||||
inputs:
|
||||
ArtifactName: drop
|
||||
PathtoPublish: $(Build.ArtifactStagingDirectory)\drop
|
||||
- template: ${{ parameters.PublishArtifactTemplate }}
|
||||
parameters:
|
||||
artifactName: drop
|
||||
path: $(Build.ArtifactStagingDirectory)\drop
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: Publish logs
|
||||
condition: succeededOrFailed()
|
||||
continueOnError: true
|
||||
inputs:
|
||||
ArtifactName: logs
|
||||
PathtoPublish: $(Build.ArtifactStagingDirectory)\logs
|
||||
- template: ${{ parameters.PublishArtifactTemplate }}
|
||||
parameters:
|
||||
displayName: Publish logs
|
||||
condition: succeededOrFailed()
|
||||
artifactName: logs
|
||||
path: $(Build.ArtifactStagingDirectory)\logs
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
parameters:
|
||||
- name: path
|
||||
type: string
|
||||
|
||||
- name: artifactName
|
||||
type: string
|
||||
|
||||
- name: displayName
|
||||
type: string
|
||||
default: 'Publish artifact'
|
||||
|
||||
- name: condition
|
||||
type: string
|
||||
default: succeeded()
|
||||
|
||||
steps:
|
||||
- task: 1ES.PublishPipelineArtifact@1
|
||||
displayName: ${{ parameters.displayName }}
|
||||
condition: ${{ parameters.condition }}
|
||||
inputs:
|
||||
targetPath: ${{ parameters.path }}
|
||||
artifactName: ${{ parameters.artifactName }}
|
|
@ -0,0 +1,23 @@
|
|||
parameters:
|
||||
- name: path
|
||||
type: string
|
||||
|
||||
- name: artifactName
|
||||
type: string
|
||||
|
||||
- name: displayName
|
||||
type: string
|
||||
default: 'Publish artifact'
|
||||
|
||||
- name: condition
|
||||
type: string
|
||||
default: succeeded()
|
||||
|
||||
steps:
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: ${{ parameters.displayName }}
|
||||
condition: ${{ parameters.condition }}
|
||||
inputs:
|
||||
PathtoPublish: ${{ parameters.path }}
|
||||
ArtifactName: ${{ parameters.artifactName }}
|
||||
publishLocation: Container
|
Загрузка…
Ссылка в новой задаче