1+ trigger :
2+ - master
3+
4+ pr :
5+ - master
6+
7+ resources :
8+ repositories :
9+ - repository : 1ESPipelineTemplates
10+ type : git
11+ name : 1ESPipelineTemplates/1ESPipelineTemplates
12+ ref : refs/tags/release
13+ name : $(Build.SourceBranchName)_$(date:yyyyMMdd)$(rev:.r)
14+
15+ extends :
16+ ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/master') }} :
17+ template : v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
18+ ${{ else }} :
19+ template : v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplates
20+ parameters :
21+ pool :
22+ name : 1ES-PT-CBL-Mariner-2.0-Gen2
23+ os : linux
24+ customBuildTags :
25+ - ES365AIMigrationTooling-BulkMigrated
26+ sdl :
27+ sourceAnalysisPool : 1ES-PT-Windows-2022
28+ stages :
29+ - stage : Stage
30+ jobs :
31+ - job : HostJob
32+ templateContext :
33+ outputs :
34+ - output : pipelineArtifact
35+ displayName : " Publish Artifact: artifacts"
36+ path : ' $(Build.ArtifactStagingDirectory)/npm'
37+ artifactName : npm
38+
39+ steps :
40+ - task : NodeTool@0
41+ inputs :
42+ versionSpec : ' 14.x'
43+ displayName : ' Install Node.js'
44+
45+ - script : |
46+ npm pack
47+ npm install -g code-push*.tgz
48+ displayName: 'Package code-push'
49+ workingDirectory: $(Build.SourcesDirectory)
50+
51+ - task : DeleteFiles@1
52+ inputs :
53+ contents : node_modules
54+ displayName : ' Delete node_modules'
55+
56+ - task : ArchiveFiles@2
57+ inputs :
58+ rootFolderOrFile : ' $(Build.SourcesDirectory)'
59+ includeRootFolder : false
60+ archiveType : ' tar'
61+ archiveFile : ' $(Build.ArtifactStagingDirectory)/npm/$(Build.BuildId).tgz'
62+ replaceExistingArchive : true
63+ verbose : true
64+ displayName : ' Prepare npm artifact'
65+
66+ - stage : APIScan
67+ dependsOn : Stage
68+ pool :
69+ name : 1ES-PT-Windows-2022
70+ os : windows
71+ variables :
72+ " agent.source.skip " : true
73+ jobs :
74+ - job : APIScan
75+ steps :
76+ - task : DownloadPipelineArtifact@2
77+ displayName : Download Pipeline Artifacts for APIScan
78+ inputs :
79+ artifactName : npm
80+ targetPath : ' $(Agent.BuildDirectory)/npm'
81+ - task : ExtractFiles@1
82+ inputs :
83+ archiveFilePatterns : ' $(Agent.BuildDirectory)/npm/*.tgz'
84+ destinationFolder : ' $(Agent.BuildDirectory)/npm_extracted'
85+ - task : AzureKeyVault@2
86+ inputs :
87+ azureSubscription : ' AC - Dev Infra & Build Pool'
88+ KeyVaultName : ' mobile-center-sdk'
89+ SecretsFilter : ' appcenter-sdk-managed-identity-clientid'
90+ RunAsPreJob : false
91+ - task : APIScan@2
92+ displayName : ' Run APIScan'
93+ inputs :
94+ softwareFolder : ' $(Agent.BuildDirectory)\npm_extracted'
95+ softwareName : ' code-push'
96+ softwareVersionNum : ' $(Build.BuildId)'
97+ isLargeApp : false
98+ toolVersion : ' Latest'
99+ verbosityLevel : verbose
100+ condition : and(succeeded(), ne(variables['DisableAPIScan'], 'true'))
101+ env :
102+ AzureServicesAuthConnectionString : ' runAs=App;AppId=$(appcenter-sdk-managed-identity-clientid)'
0 commit comments