2
2
# Licensed under the MIT License.
3
3
4
4
parameters :
5
- - name : prerelease
6
- type : boolean
7
- default : false
5
+ - name : prerelease
6
+ type : boolean
7
+ default : false
8
8
9
9
jobs :
10
- - job : Build
11
- pool :
12
- name : VSEngSS-MicroBuild2019-1ES
13
- variables :
14
- # MicroBuild requires TeamName to be set.
15
- TeamName : C++ Cross Platform and Cloud
16
- steps :
17
- - task : MicroBuildSigningPlugin@3
18
- displayName : Install MicroBuild Signing
19
- inputs :
20
- signType : $(SignType)
21
- zipSources : false
22
- # MicroBuild signing will always fail on public PRs.
23
- condition : ne(variables['Build.Reason'], 'PullRequest')
24
-
25
- # Run these scanners first so that they don't detect issues in dependencies.
26
- # Failures won't break the build until "Check for compliance errors" step.
27
- - task : CredScan@3
28
- displayName : Run CredScan
29
- inputs :
30
- toolMajorVersion : V2
31
- - task : PoliCheck@2
32
- displayName : Run PoliCheck
33
- inputs :
34
- targetType : F
35
- targetArgument : $(Build.SourcesDirectory)
36
-
37
- # Node 14 matches the version of Node used by VS Code when this was written,
38
- # but it should be updated when VS Code updates its Node version.
39
- - task : NodeTool@0
40
- displayName : Use Node 16.x
41
- inputs :
42
- versionSpec : 16.x
43
-
44
- # Override the patch version if this is a pre-release build.
45
- - ${{ if parameters.prerelease }} :
46
- - pwsh : node -e "p=require('./package.json');p.version=p.version.replace(/\.\d+$/,'.'+$(Build.BuildNumber));require('fs').writeFileSync('./package.json',JSON.stringify(p,undefined,2))"
47
-
48
- - script : npm install --global gulp node-gyp @vscode/vsce
49
- displayName : Install global dependencies
50
- - script : npm install
51
- displayName : Install project dependencies
52
-
53
- - task : ComponentGovernanceComponentDetection@0
54
- displayName : Detect components
55
- - task : notice@0
56
- displayName : Generate NOTICE file
57
- inputs :
58
- outputfile : $(Build.SourcesDirectory)/NOTICE.txt
59
- condition : and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
60
-
61
- - script : gulp tslint
62
- displayName : Check for linting errors
63
- - script : gulp genAikey
64
- displayName : Use production AI key
65
- condition : and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags'))
66
- # Pack the extension now even though it's unsigned so that we ignore files
67
- # from .vscodeignore. This will reduce load on the signing server later and
68
- # ensure we only attempt to sign shipping files.
69
- - ${{ if parameters.prerelease }} :
70
- - script : node build/package.js --pre-release
71
- displayName : Build and pack extension
72
- - ${{ else }} :
73
- - script : node build/package.js
74
- displayName : Build and pack extension
75
-
76
- # Extract the VSIXes, sign what we can, then pack it back up and publish it.
77
- - pwsh : |
78
- $path = Join-Path $Env:TEMP "7z-installer.exe"
79
- Invoke-WebRequest https://www.7-zip.org/a/7z2201-x64.exe -OutFile $path
80
- Start-Process -FilePath $path -Args "/S" -Verb RunAs -Wait
81
- Remove-Item $path
82
- Echo "##vso[task.prependpath]$Env:PROGRAMFILES\7-Zip\"
83
- displayName: Install 7zip
84
- - pwsh : Get-ChildItem out\vsix | Foreach-Object { 7z x $_.FullName -o$(Build.StagingDirectory)\vscode-arduino\$($_.BaseName) }
85
- displayName : Extract extension for signing
86
- - task : NuGetToolInstaller@1
87
- displayName : Install NuGet
88
- - task : NuGetAuthenticate@0
89
- displayName : Authenticate NuGet
90
- - script : nuget restore .\build\SignFiles.proj -PackagesDirectory .\build\packages
91
- displayName : Restore MicroBuild Core
92
- # MicroBuild signing will always fail on public PRs.
93
- condition : ne(variables['Build.Reason'], 'PullRequest')
94
- - task : MSBuild@1
95
- displayName : Sign files
96
- inputs :
97
- solution : .\build\SignFiles.proj
98
- msbuildArguments : /p:SignType=$(SignType)
99
- # MicroBuild signing will always fail on public PRs.
100
- condition : ne(variables['Build.Reason'], 'PullRequest')
101
- - pwsh : |
102
- Get-ChildItem -Directory $(Build.StagingDirectory)\vscode-arduino | Foreach-Object { 7z a ($_.FullName + ".vsix") ($_.FullName + "\*") -tzip }
103
- New-Item -Path $(Build.StagingDirectory)\vscode-arduino\vsix -ItemType Directory
104
- Get-Item $(Build.StagingDirectory)\vscode-arduino\*.vsix | Move-Item -Destination $(Build.StagingDirectory)\vscode-arduino\vsix
105
- displayName: Pack signed files
106
- - task : MSBuild@1
107
- displayName : Sign VSIXes
108
- inputs :
109
- solution : .\build\SignVsix.proj
110
- msbuildArguments : /p:SignType=$(SignType)
111
- # MicroBuild signing will always fail on public PRs.
112
- condition : ne(variables['Build.Reason'], 'PullRequest')
113
- - publish : $(Build.StagingDirectory)\vscode-arduino\vsix
114
- artifact : extension-vsixes
115
- displayName : Publish extension VSIXes as artifact
116
-
117
- # Install the Arduino IDE and run tests.
118
- - script : curl -LO https://downloads.arduino.cc/arduino-1.8.19-windows.zip
119
- displayName : Download Arduino IDE
120
- - script : >-
121
- node build/checkHash.js arduino-1.8.19-windows.zip
122
- c704a821089eab2588f1deae775916219b1517febd1dd574ff29958dca873945
123
- displayName: Verify Arduino IDE
124
- - task : ExtractFiles@1
125
- displayName : Extract Arduino IDE
126
- inputs :
127
- archiveFilePatterns : arduino-1.8.19-windows.zip
128
- destinationFolder : arduino-ide
129
- - script : " echo ##vso[task.prependpath]$(Build.SourcesDirectory)\\ arduino-ide\\ arduino-1.8.19"
130
- displayName : Add Arduino IDE to PATH
131
- - script : npm test --silent
132
- displayName : Run tests
133
-
134
- - task : PostAnalysis@2
135
- displayName : Check for compliance errors
136
- # To avoid spirious warnings about missing logs, explicitly declare what we scanned.
137
- inputs :
138
- CredScan : true
139
- PoliCheck : true
140
-
141
- # Trust Services Automation (TSA) can automatically open bugs for compliance issues.
142
- # https://www.1eswiki.com/wiki/Trust_Services_Automation_(TSA)
143
- - task : TSAUpload@2
144
- displayName : Upload logs to TSA
145
- inputs :
146
- GdnPublishTsaOnboard : true
147
- GdnPublishTsaConfigFile : $(Build.SourcesDirectory)\build\tsa.gdntsa
148
- # Don't open bugs for PR builds
149
- condition : ne(variables['Build.Reason'], 'PullRequest')
150
-
151
- - task : GitHubRelease@0
152
- displayName : Publish to GitHub
153
- inputs :
154
- gitHubConnection : embeddedbot
155
- repositoryName : microsoft/vscode-arduino
156
- action : create
157
- target : $(Build.SourceVersion)
158
- tagSource : auto
159
- assets : $(Build.StagingDirectory)\vscode-arduino\vsix\*.vsix
160
- isPreRelease : $[contains(variables['Build.SourceBranch'], '-rc')]
161
- condition : and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags'))
162
-
163
- - task : MicroBuildCleanup@1
164
- displayName : Clean up MicroBuild
10
+ - job : Build
11
+ pool :
12
+ name : VSEngSS-MicroBuild2022-1ES
13
+ variables :
14
+ TeamName : C++ Cross Platform and Cloud
15
+ templateContext :
16
+ outputs :
17
+ - output : pipelineArtifact
18
+ displayName : ' Publish extension VSIXes as artifact'
19
+ targetPath : $(Build.StagingDirectory)\vscode-arduino\vsix
20
+ artifactName : extension-vsixes
21
+ steps :
22
+ - task : MicroBuildSigningPlugin@3
23
+ displayName : Install MicroBuild Signing
24
+ inputs :
25
+ signType : $(SignType)
26
+ zipSources : false
27
+ condition : ne(variables['Build.Reason'], 'PullRequest')
28
+ - task : CredScan@3
29
+ displayName : Run CredScan
30
+ inputs :
31
+ toolMajorVersion : V2
32
+ - task : PoliCheck@2
33
+ displayName : Run PoliCheck
34
+ inputs :
35
+ targetType : F
36
+ targetArgument : $(Build.SourcesDirectory)
37
+ - task : NodeTool@0
38
+ displayName : Use Node 16.x
39
+ inputs :
40
+ versionSpec : 16.x
41
+ - ${{ if parameters.prerelease }} :
42
+ - pwsh : node -e "p=require('./package.json');p.version=p.version.replace(/\.\d+$/,'.'+$(Build.BuildNumber));require('fs').writeFileSync('./package.json',JSON.stringify(p,undefined,2))"
43
+ - script : npm install --global gulp node-gyp @vscode/vsce
44
+ displayName : Install global dependencies
45
+ - script : npm install
46
+ displayName : Install project dependencies
47
+ - task : ComponentGovernanceComponentDetection@0
48
+ displayName : Detect components
49
+ - task : notice@0
50
+ displayName : Generate NOTICE file
51
+ inputs :
52
+ outputfile : $(Build.SourcesDirectory)/NOTICE.txt
53
+ condition : and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
54
+ - script : gulp tslint
55
+ displayName : Check for linting errors
56
+ - script : gulp genAikey
57
+ displayName : Use production AI key
58
+ condition : and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags'))
59
+ - ${{ if parameters.prerelease }} :
60
+ - script : node build/package.js --pre-release
61
+ displayName : Build and pack extension
62
+ - ${{ else }} :
63
+ - script : node build/package.js
64
+ displayName : Build and pack extension
65
+ - pwsh : |
66
+ $path = Join-Path $Env:TEMP "7z-installer.exe"
67
+ Invoke-WebRequest https://www.7-zip.org/a/7z2201-x64.exe -OutFile $path
68
+ Start-Process -FilePath $path -Args "/S" -Verb RunAs -Wait
69
+ Remove-Item $path
70
+ Echo "##vso[task.prependpath]$Env:PROGRAMFILES\7-Zip\"
71
+ displayName: Install 7zip
72
+ - pwsh : Get-ChildItem out\vsix | Foreach-Object { 7z x $_.FullName -o$(Build.StagingDirectory)\vscode-arduino\$($_.BaseName) }
73
+ displayName : Extract extension for signing
74
+ - task : NuGetToolInstaller@1
75
+ displayName : Install NuGet
76
+ - task : NuGetAuthenticate@0
77
+ displayName : Authenticate NuGet
78
+ - script : nuget restore .\build\SignFiles.proj -PackagesDirectory .\build\packages
79
+ displayName : Restore MicroBuild Core
80
+ condition : ne(variables['Build.Reason'], 'PullRequest')
81
+ - task : MSBuild@1
82
+ displayName : Sign files
83
+ inputs :
84
+ solution : .\build\SignFiles.proj
85
+ msbuildArguments : /p:SignType=$(SignType)
86
+ condition : ne(variables['Build.Reason'], 'PullRequest')
87
+ - pwsh : |
88
+ Get-ChildItem -Directory $(Build.StagingDirectory)\vscode-arduino | Foreach-Object { 7z a ($_.FullName + ".vsix") ($_.FullName + "\*") -tzip }
89
+ New-Item -Path $(Build.StagingDirectory)\vscode-arduino\vsix -ItemType Directory
90
+ Get-Item $(Build.StagingDirectory)\vscode-arduino\*.vsix | Move-Item -Destination $(Build.StagingDirectory)\vscode-arduino\vsix
91
+ displayName: Pack signed files
92
+ - task : MSBuild@1
93
+ displayName : Sign VSIXes
94
+ inputs :
95
+ solution : .\build\SignVsix.proj
96
+ msbuildArguments : /p:SignType=$(SignType)
97
+ condition : ne(variables['Build.Reason'], 'PullRequest')
98
+ - script : curl -LO https://downloads.arduino.cc/arduino-1.8.19-windows.zip
99
+ displayName : Download Arduino IDE
100
+ - script : >-
101
+ node build/checkHash.js arduino-1.8.19-windows.zip c704a821089eab2588f1deae775916219b1517febd1dd574ff29958dca873945
102
+ displayName: Verify Arduino IDE
103
+ - task : ExtractFiles@1
104
+ displayName : Extract Arduino IDE
105
+ inputs :
106
+ archiveFilePatterns : arduino-1.8.19-windows.zip
107
+ destinationFolder : arduino-ide
108
+ - script : " echo ##vso[task.prependpath]$(Build.SourcesDirectory)\\ arduino-ide\\ arduino-1.8.19"
109
+ displayName : Add Arduino IDE to PATH
110
+ - script : npm test --silent
111
+ displayName : Run tests
112
+ - task : PostAnalysis@2
113
+ displayName : Check for compliance errors
114
+ inputs :
115
+ CredScan : true
116
+ PoliCheck : true
117
+ - task : TSAUpload@2
118
+ displayName : Upload logs to TSA
119
+ inputs :
120
+ GdnPublishTsaOnboard : true
121
+ GdnPublishTsaConfigFile : $(Build.SourcesDirectory)\build\tsa.gdntsa
122
+ condition : ne(variables['Build.Reason'], 'PullRequest')
123
+ - task : GitHubRelease@0
124
+ displayName : Publish to GitHub
125
+ inputs :
126
+ gitHubConnection : embeddedbot
127
+ repositoryName : microsoft/vscode-arduino
128
+ action : create
129
+ target : $(Build.SourceVersion)
130
+ tagSource : auto
131
+ assets : $(Build.StagingDirectory)\vscode-arduino\vsix\*.vsix
132
+ isPreRelease : $[contains(variables['Build.SourceBranch'], '-rc')]
133
+ condition : and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags'))
134
+ - task : MicroBuildCleanup@1
135
+ displayName : Clean up MicroBuild
0 commit comments