1010
1111trigger : none
1212
13+ parameters :
14+ - name : debug
15+ displayName : Enable debug output
16+ type : boolean
17+ default : false
18+
1319variables :
14- CDP_DEFINITION_BUILD_COUNT : $[counter('', 0)] # needed for onebranch.pipeline.version task https://aka.ms/obpipelines/versioning
15- LinuxContainerImage : ' mcr.microsoft.com/onebranch/cbl-mariner/build:2.0' # Docker image which is used to build the project https://aka.ms/obpipelines/containers
16- DEBIAN_FRONTEND : noninteractive
20+ system.debug : ${{ parameters.debug }}
21+ WindowsContainerImage : onebranch.azurecr.io/windows/ltsc2019/vse2022:latest
1722
1823resources :
1924 repositories :
@@ -23,65 +28,133 @@ resources:
2328 ref : refs/heads/main
2429
2530extends :
26- template : v2/OneBranch.Official.CrossPlat.yml@templates # https://aka.ms/obpipelines/templates
31+ # https://aka.ms/obpipelines/templates
32+ template : v2/OneBranch.Official.CrossPlat.yml@templates
2733 parameters :
28- cloudvault : # https://aka.ms/obpipelines/cloudvault
29- enabled : false # set to true to enable cloudvault
30- runmode : stage # linux can run CloudVault upload as a separate stage
31- dependsOn : linux_build
32- artifacts :
33- - drop_linux_stage_linux_job
34-
3534 globalSdl : # https://aka.ms/obpipelines/sdl
36- # tsa:
37- # enabled: true # SDL results of non-official builds aren't uploaded to TSA by default.
38- # credscan:
39- # suppressionsFile: $(Build.SourcesDirectory)\.config\CredScanSuppressions.json
40- policheck :
41- break : true # always break the build on policheck issues. You can disable it by setting to 'false'
42- # suppression:
43- # suppressionFile: $(Build.SourcesDirectory)\.gdn\global.gdnsuppress
44-
35+ asyncSdl :
36+ enabled : true
37+ forStages : [build]
4538 stages :
46- - stage : linux_stage
39+ - stage : build
4740 jobs :
48- - job : linux_job
41+ - job : main
42+ displayName : Build package
4943 pool :
50- type : linux
51-
52- variables : # More settings at https://aka.ms/obpipelines/yaml/jobs
53- ob_outputDirectory : ' $(Build.SourcesDirectory)/out' # this directory is uploaded to pipeline artifacts, reddog and cloudvault. More info at https://aka.ms/obpipelines/artifacts
54-
55- steps : # These steps will be run in unrestricted container's network
44+ type : windows
45+ variables :
46+ ob_outputDirectory : $(Build.SourcesDirectory)/out
47+ steps :
48+ - pwsh : Write-Output "##vso[task.setvariable variable=version;isOutput=true]$((Get-Content -Raw -Path package.json | ConvertFrom-Json).version)"
49+ name : package
50+ displayName : Get version from package.json
5651 - task : onebranch.pipeline.version@1
57- displayName : ' Setup BuildNumber '
52+ displayName : Set OneBranch version
5853 inputs :
59- system : ' RevisionCounter'
60- major : ' 1'
61- minor : ' 0'
62- exclude_commit : true
63-
64- - task : Bash@3
65- displayName : ' Restore'
54+ system : Custom
55+ customVersion : $(package.version)
56+ - task : UseNode@1
57+ displayName : Use Node 18.x
6658 inputs :
67- filePath : ' $(Build.SourcesDirectory)/restore.sh'
68-
69- - task : Bash@3
70- displayName : ' Build'
59+ version : 18.x
60+ - task : npmAuthenticate@0
61+ displayName : Authenticate NPM with Azure Artifacts
7162 inputs :
72- filePath : ' $(Build.SourcesDirectory)/build.sh'
73-
74- - task : Bash@3
75- displayName : ' Package'
63+ workingFile : .npmrc
64+ - pwsh : npm ci
65+ displayName : Install NPM packages
66+ - pwsh : npm run compile -- --minify
67+ displayName : Build minified extension
68+ - task : onebranch.pipeline.signing@1
69+ displayName : Sign 1st-party files
7670 inputs :
77- filePath : ' $(Build.SourcesDirectory)/package.sh'
78-
79- - task : Bash@3
80- displayName : ' Copy Extra Files'
71+ command : sign
72+ signing_environment : external_distribution
73+ search_root : $(Build.SourcesDirectory)/dist
74+ files_to_sign : extension.js
75+ - pwsh : New-Item -ItemType Directory -Force out && npm run package -- --out out/
76+ displayName : Create package
77+ - job : test
78+ displayName : Build and run tests
79+ pool :
80+ type : windows
81+ isCustom : true
82+ name : Azure Pipelines
83+ vmImage : windows-latest
84+ variables :
85+ ob_outputDirectory : $(Build.SourcesDirectory)/out
86+ skipComponentGovernanceDetection : true
87+ steps :
88+ - task : UseNode@1
89+ displayName : Use Node 18.x
8190 inputs :
82- targetType : ' inline'
83- script : |
84- mkdir -p $(Build.SourcesDirectory)/out
85- cp -a $(Build.SourcesDirectory)/linux_deploy $(Build.SourcesDirectory)/out
86- cp $(Build.SourcesDirectory)/*.tgz $(Build.SourcesDirectory)/out
87- cp $(Build.SourcesDirectory)/*.tgz.sha256 $(Build.SourcesDirectory)/out
91+ version : 18.x
92+ - task : npmAuthenticate@0
93+ displayName : Authenticate NPM with Azure Artifacts
94+ inputs :
95+ workingFile : .npmrc
96+ - pwsh : npm ci
97+ displayName : Install NPM packages
98+ - pwsh : npm run test
99+ displayName : Run tests
100+ - stage : release
101+ dependsOn : build
102+ variables :
103+ version : $[ stageDependencies.build.main.outputs['package.version'] ]
104+ drop : $(Pipeline.Workspace)/drop_build_main
105+ jobs :
106+ - job : validation
107+ displayName : Manual validation
108+ pool :
109+ type : agentless
110+ timeoutInMinutes : 1440
111+ steps :
112+ - task : ManualValidation@0
113+ displayName : Wait 24 hours for validation
114+ inputs :
115+ notifyUsers : $(Build.RequestedForEmail)
116+ instructions : Please validate the release
117+ timeoutInMinutes : 1440
118+ - job : github
119+ dependsOn : validation
120+ displayName : Publish draft to GitHub
121+ pool :
122+ type : windows
123+ variables :
124+ ob_outputDirectory : $(Build.SourcesDirectory)/out
125+ steps :
126+ - download : current
127+ displayName : Download artifacts
128+ - task : GitHubRelease@1
129+ displayName : Create GitHub release
130+ inputs :
131+ gitHubConnection : GitHub
132+ repositoryName : microsoft/vscode-azurearcenabledmachines
133+ assets : $(drop)/vscode-azurearcenabledmachines-$(version).vsix
134+ tagSource : userSpecifiedTag
135+ tag : v$(version)
136+ isDraft : true
137+ addChangeLog : false
138+ releaseNotesSource : inline
139+ releaseNotesInline : |
140+ # TODO: Generate release notes on GitHub!
141+ - job : vscode
142+ dependsOn : validation
143+ displayName : Publish to VS Code Marketplace
144+ pool :
145+ type : windows
146+ variables :
147+ - group : VSCodeMarketplace
148+ - name : ob_outputDirectory
149+ value : $(Build.SourcesDirectory)/out
150+ steps :
151+ - download : current
152+ displayName : Download artifacts
153+ - task : npmAuthenticate@0
154+ displayName : Install NPM packages (for vsce)
155+ inputs :
156+ workingFile : .npmrc
157+ - pwsh : npm ci
158+ displayName : Install NPM packages (for vsce)
159+ - pwsh : npm run publish -- --pat $(token) --packagePath $(drop)/vscode-azurearcenabledmachines-$(version).vsix
160+ displayName : Run vsce publish
0 commit comments