|
16 | 16 | - README.md
|
17 | 17 | - Documentation/*
|
18 | 18 |
|
| 19 | +parameters: |
| 20 | +- name: ApiScanSourceBranch |
| 21 | + default: 'refs/heads/main' |
| 22 | + |
19 | 23 | # Global variables
|
20 | 24 | variables:
|
21 | 25 | RunningOnCI: true
|
@@ -57,19 +61,11 @@ jobs:
|
57 | 61 |
|
58 | 62 | - template: templates\fail-on-issue.yaml
|
59 | 63 |
|
60 |
| - - task: ArchiveFiles@2 |
61 |
| - displayName: 'Archive build outputs' |
62 |
| - inputs: |
63 |
| - rootFolderOrFile: 'bin' |
64 |
| - archiveType: 'zip' |
65 |
| - archiveFile: '$(Build.ArtifactStagingDirectory)/bin-dotnet.zip' |
66 |
| - replaceExistingArchive: true |
67 |
| - condition: succeededOrFailed() |
68 |
| - |
69 |
| - - task: PublishBuildArtifacts@1 |
70 |
| - displayName: 'Publish Artifact: debug' |
| 64 | + - task: PublishPipelineArtifact@1 |
| 65 | + displayName: Publish build artifacts |
71 | 66 | inputs:
|
72 |
| - ArtifactName: debug |
| 67 | + artifactName: artifacts |
| 68 | + targetPath: bin |
73 | 69 | condition: succeededOrFailed()
|
74 | 70 |
|
75 | 71 | - job: mac_dotnet_build
|
|
96 | 92 | - template: templates\fail-on-issue.yaml
|
97 | 93 |
|
98 | 94 |
|
| 95 | +- job: api_scan |
| 96 | + displayName: API Scan |
| 97 | + dependsOn: windows_dotnet_build |
| 98 | + condition: and(eq(dependencies.windows_dotnet_build.result, 'Succeeded'), eq(variables['Build.SourceBranch'], '${{ parameters.ApiScanSourceBranch }}')) |
| 99 | + pool: |
| 100 | + name: Azure Pipelines |
| 101 | + vmImage: windows-2022 |
| 102 | + timeoutInMinutes: 480 |
| 103 | + workspace: |
| 104 | + clean: all |
| 105 | + steps: |
| 106 | + - task: DownloadPipelineArtifact@2 |
| 107 | + displayName: Download build artifacts |
| 108 | + inputs: |
| 109 | + artifactName: artifacts |
| 110 | + downloadPath: $(Build.SourcesDirectory) |
| 111 | + |
| 112 | + ### Copy .dll, .exe, .pdb files for APIScan |
| 113 | + - task: CopyFiles@2 |
| 114 | + displayName: Collect Files for APIScan |
| 115 | + inputs: |
| 116 | + Contents: | |
| 117 | + $(Build.SourcesDirectory)\$(Build.Configuration)$(NetCoreTargetFrameworkPathSuffix)\**\?(*.dll|*.exe|*.pdb) |
| 118 | + !$(Build.SourcesDirectory)\**\jnimarshalmethod-gen.* |
| 119 | + !$(Build.SourcesDirectory)\**\Mono.CSharp.dll |
| 120 | + !$(Build.SourcesDirectory)\**\SgmlReader.exe |
| 121 | + !$(Build.SourcesDirectory)\**\win-*\java-interop.dll |
| 122 | + TargetFolder: $(Build.StagingDirectory)\apiscan |
| 123 | + OverWrite: true |
| 124 | + flattenFolders: true |
| 125 | + |
| 126 | + - task: APIScan@2 |
| 127 | + displayName: Run APIScan |
| 128 | + inputs: |
| 129 | + softwareFolder: $(Build.StagingDirectory)\apiscan |
| 130 | + symbolsFolder: 'SRV*http://symweb;$(Build.StagingDirectory)\apiscan' |
| 131 | + softwareName: $(ApiScanName) |
| 132 | + softwareVersionNum: $(Build.SourceBranchName)-$(Build.SourceVersion)$(System.JobAttempt) |
| 133 | + isLargeApp: true |
| 134 | + toolVersion: Latest |
| 135 | + env: |
| 136 | + AzureServicesAuthConnectionString: runAs=App;AppId=$(ApiScanClientId);TenantId=$(ApiScanTenant);AppKey=$(ApiScanSecret) |
| 137 | + |
| 138 | + - task: SdtReport@2 |
| 139 | + displayName: Guardian Export - Security Report |
| 140 | + inputs: |
| 141 | + GdnExportAllTools: false |
| 142 | + GdnExportGdnToolApiScan: true |
| 143 | + GdnExportOutputSuppressionFile: source.gdnsuppress |
| 144 | + |
| 145 | + - task: PublishSecurityAnalysisLogs@3 |
| 146 | + displayName: Publish Guardian Artifacts |
| 147 | + inputs: |
| 148 | + ArtifactName: APIScan Logs |
| 149 | + ArtifactType: Container |
| 150 | + AllTools: false |
| 151 | + APIScan: true |
| 152 | + ToolLogsNotFoundAction: Warning |
| 153 | + |
| 154 | + - task: PostAnalysis@2 |
| 155 | + displayName: Fail Build on Guardian Issues |
| 156 | + inputs: |
| 157 | + GdnBreakAllTools: false |
| 158 | + GdnBreakGdnToolApiScan: true |
| 159 | + |
| 160 | + |
99 | 161 | - job: OneLocBuild
|
100 | 162 | displayName: OneLocBuild
|
101 | 163 | condition: and(eq(variables['System.TeamProject'], 'DevDiv'), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
|
|
0 commit comments