Skip to content

Commit 0ca6b2b

Browse files
authored
Sign official builds of the vscode extensions (#4007)
* Sign official builds of the vscode extensions * Add msbuild-sdk NoTargets to global.json * Fix ordering of steps * Workaround Arcade error * Update vsce call * Update vsce to 3.6.0 * Update to a newer version of node compatible with vsce * Update TypeScript to work with latest NodeJs * Fix yml * Switch to LTS NodeJs 22 * Support node type stripping by using as for type casts * Update typescript and syntax of polygot-notebooks folder * Update typescript and syntax of polygot-notebooks-browser folder * Use as * Update typescript of polyglot-notebook-ui-components * Downgrade npm on windows builds * Update package publishing * Move to @vscode/vsce 3.6.1-3 * Workaround packaging failure * Workaround 2 * Add tests/** to vscodeignore file * Fix vscodeignore
1 parent db7990f commit 0ca6b2b

File tree

72 files changed

+14401
-16274
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+14401
-16274
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// Append -bullseye or -focal to pin to an OS version.
1010
"VARIANT": "9.0",
1111
// Options
12-
"NODE_VERSION": "16"
12+
"NODE_VERSION": "22"
1313
}
1414
},
1515
// Set *default* container specific settings.json values on container create.
@@ -73,4 +73,4 @@
7373
"features": {
7474
"powershell": "latest"
7575
}
76-
}
76+
}

azure-pipelines-official.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ extends:
5151
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
5252
parameters:
5353
sdl:
54-
sourceAnalysisPool:
54+
sourceAnalysisPool:
5555
name: $(DncEngInternalBuildPool)
5656
image: 1es-windows-2022
5757
os: windows
@@ -152,6 +152,7 @@ extends:
152152
- template: /eng/templates/build-and-test-tasks.yml@self
153153
parameters:
154154
platform: windows
155+
signType: $(_SignType)
155156

156157
- template: /eng/common/templates-official/jobs/jobs.yml@self
157158
parameters:
@@ -212,7 +213,7 @@ extends:
212213
-TsaCodebaseName "Interactive-GitHub"
213214
-TsaPublish $True
214215
-PoliCheckAdditionalRunConfigParams @("UserExclusionPath < $(Build.SourcesDirectory)/eng/policheck_exclusions.xml")
215-
216+
216217
#---------------------------------------------------------------------------------------------------------------------#
217218
# NPM Publish #
218219
#---------------------------------------------------------------------------------------------------------------------#

eng/msbuild/Directory.Build.props

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project>
2+
<PropertyGroup>
3+
<RepoRoot>$(MSBuildThisFileDirectory)../../</RepoRoot>
4+
</PropertyGroup>
5+
6+
<PropertyGroup Condition="'$(SignType)' == ''">
7+
<SignType>test</SignType>
8+
</PropertyGroup>
9+
10+
<!-- The Arcade.SDK will error if this is unset. This is fixed in more recent Arcade builds. -->
11+
<PropertyGroup Condition="'$(_SuppressSdkImports)' == ''">
12+
<_SuppressSdkImports>true</_SuppressSdkImports>
13+
</PropertyGroup>
14+
</Project>

eng/msbuild/Directory.Packages.props

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project>
2+
<!-- https://learn.microsoft.com/nuget/consume-packages/central-package-management -->
3+
<PropertyGroup>
4+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
5+
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
6+
</PropertyGroup>
7+
<ItemGroup>
8+
<GlobalPackageReference Include="Microsoft.VisualStudioEng.MicroBuild.Core" Version="1.0.0" />
9+
</ItemGroup>
10+
</Project>

eng/msbuild/signJs/signJs.proj

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.Build.NoTargets">
2+
<PropertyGroup>
3+
<TargetFramework>netstandard2.0</TargetFramework>
4+
<GenerateAssemblyVersionInfo>false</GenerateAssemblyVersionInfo>
5+
<EnableDefaultSignFiles>false</EnableDefaultSignFiles>
6+
<MicroBuild_DoNotStrongNameSign>true</MicroBuild_DoNotStrongNameSign>
7+
<IsPackable>false</IsPackable>
8+
<OutDir>$(MSBuildProjectDirectory)\$(JSOutputPath)\</OutDir>
9+
<MicroBuild_SigningEnabled>true</MicroBuild_SigningEnabled>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<FilesToSign Include="$(OutDir)*.js">
14+
<Authenticode>MicrosoftSHA2</Authenticode>
15+
</FilesToSign>
16+
</ItemGroup>
17+
</Project>

eng/msbuild/signVsix/signVsix.proj

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<Project Sdk="Microsoft.Build.NoTargets">
2+
<PropertyGroup>
3+
<TargetFramework>netstandard2.0</TargetFramework>
4+
<GenerateAssemblyVersionInfo>false</GenerateAssemblyVersionInfo>
5+
<EnableDefaultSignFiles>false</EnableDefaultSignFiles>
6+
<MicroBuild_DoNotStrongNameSign>true</MicroBuild_DoNotStrongNameSign>
7+
<IsPackable>false</IsPackable>
8+
<OutDir>$(RepoRoot)artifacts\vscode\</OutDir>
9+
</PropertyGroup>
10+
<ItemGroup>
11+
<FilesToSign Include="$(OutDir)stable-locked\*.vsix">
12+
<Authenticode>VSCodePublisher</Authenticode>
13+
</FilesToSign>
14+
<FilesToSign Include="$(OutDir)stable\*.vsix">
15+
<Authenticode>VSCodePublisher</Authenticode>
16+
</FilesToSign>
17+
<FilesToSign Include="$(OutDir)insiders\*.vsix">
18+
<Authenticode>VSCodePublisher</Authenticode>
19+
</FilesToSign>
20+
</ItemGroup>
21+
</Project>

eng/package/PackVSCodeExtension.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@ function Build-VsCodeExtension([string] $packageDirectory, [string] $outputSubDi
3030

3131
# pack
3232
Write-Host "Packing extension"
33-
npm run package -- --out "$outDir\$outputSubDirectory\dotnet-interactive-vscode-$packageVersionNumber.vsix"
33+
npx @vscode/vsce package -o "$outDir\$outputSubDirectory\dotnet-interactive-vscode-$packageVersionNumber.vsix"
34+
35+
Write-Host "Generating extension manifest"
36+
npx @vscode/vsce generate-manifest -i "$outDir\$outputSubDirectory\dotnet-interactive-vscode-$packageVersionNumber.vsix" -o "$outDir\$outputSubDirectory\dotnet-interactive-vscode-$packageVersionNumber.manifest"
37+
38+
Write-Host "Preparing manifest for signing"
39+
Copy-Item -Path "$outDir\$outputSubDirectory\dotnet-interactive-vscode-$packageVersionNumber.manifest" -Destination "$outDir\$outputSubDirectory\dotnet-interactive-vscode-$packageVersionNumber.signature.p7s"
3440

3541
Pop-Location
3642
}

eng/publish/PublishPolyglotNotebooksHelper.psm1

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ function PublishInsidersExtension {
1010
$extension = Get-ChildItem "$artifactsPath\vscode\insiders\dotnet-interactive-vscode-*.vsix" | Select-Object -First 1
1111
Write-Host "Found extension: $extension"
1212

13+
Write-Host "Find extension manifest..."
14+
$manifest = Get-ChildItem "$artifactsPath\vscode\insiders\dotnet-interactive-vscode-*.manifest" | Select-Object -First 1
15+
Write-Host "Found extension: $manifest"
16+
17+
Write-Host "Find extension signature..."
18+
$signature = Get-ChildItem "$artifactsPath\vscode\insiders\dotnet-interactive-vscode-*.signature.p7s" | Select-Object -First 1
19+
Write-Host "Found extension: $signature"
20+
1321
Write-Host "Verify the extension..."
1422
if ($simulate) {
1523
Write-Host "Simulated command: . '$PSScriptRoot\VerifyVSCodeExtension.ps1' -extensionPath $extension"
@@ -22,9 +30,9 @@ function PublishInsidersExtension {
2230

2331
Write-Host "Publishing extension $extension to VS Code Marketplace using Managed Identity..."
2432
if ($simulate) {
25-
Write-Host "Simulated command: vsce publish --pre-release --packagePath $extension --noVerify --azure-credential"
33+
Write-Host "Simulated command: vsce publish --pre-release --packagePath $extension --manifestPath $manifest --signaturePath $signature --noVerify --azure-credential"
2634
} else {
27-
vsce publish --pre-release --packagePath $extension --noVerify --azure-credential
35+
vsce publish --pre-release --packagePath $extension --manifestPath $manifest --signaturePath $signature --noVerify --azure-credential
2836
}
2937
}
3038

@@ -41,6 +49,14 @@ function PublishStableExtensionAndNuGetPackages {
4149
$extension = Get-ChildItem "$artifactsPath\vscode\stable\dotnet-interactive-vscode-*.vsix" | Select-Object -First 1
4250
Write-Host "Found extension: $extension"
4351

52+
Write-Host "Find extension manifest..."
53+
$manifest = Get-ChildItem "$artifactsPath\vscode\stable\dotnet-interactive-vscode-*.manifest" | Select-Object -First 1
54+
Write-Host "Found extension: $manifest"
55+
56+
Write-Host "Find extension signature..."
57+
$signature = Get-ChildItem "$artifactsPath\vscode\stable\dotnet-interactive-vscode-*.signature.p7s" | Select-Object -First 1
58+
Write-Host "Found extension: $signature"
59+
4460
Write-Host "Verify the extension..."
4561
if ($simulate) {
4662
Write-Host "Simulated command: . '$PSScriptRoot\VerifyVSCodeExtension.ps1' -extensionPath $extension"
@@ -102,8 +118,8 @@ function PublishStableExtensionAndNuGetPackages {
102118

103119
Write-Host "Publishing extension $extension to VS Code Marketplace using Managed Identity..."
104120
if ($simulate) {
105-
Write-Host "Simulated command: vsce publish --packagePath $extension --noVerify --azure-credential"
121+
Write-Host "Simulated command: vsce publish --packagePath $extension --manifestPath $manifest --signaturePath $signature --noVerify --azure-credential"
106122
} else {
107-
vsce publish --packagePath $extension --noVerify --azure-credential
123+
vsce publish --packagePath $extension --manifestPath $manifest --signaturePath $signature --noVerify --azure-credential
108124
}
109125
}

eng/publish/PublishVSCodeExtension.ps1

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ try {
2121

2222
# find extension vsix
2323
$extension = Get-ChildItem "$artifactsPath\vscode\$vscodeTarget\dotnet-interactive-vscode-*.vsix" | Select-Object -First 1
24+
$manifest = Get-ChildItem "$artifactsPath\vscode\$vscodeTarget\dotnet-interactive-vscode-*.manifest" | Select-Object -First 1
25+
$signature = Get-ChildItem "$artifactsPath\vscode\$vscodeTarget\dotnet-interactive-vscode-*.signature.p7s" | Select-Object -First 1
2426

2527
# verify
2628
if (-Not $simulate) {
@@ -35,7 +37,7 @@ try {
3537
$packagestoPublish = @(
3638
"Microsoft.dotnet-interactive",
3739
"Microsoft.DotNet.Interactive",
38-
"Microsoft.DotNet.Interactive.AspNetCore",
40+
"Microsoft.DotNet.Interactive.AspNetCore",
3941
"Microsoft.DotNet.Interactive.Browser",
4042
"Microsoft.DotNet.Interactive.CSharp",
4143
"Microsoft.DotNet.Interactive.Documents",
@@ -80,12 +82,12 @@ try {
8082
Write-Host "Publishing $extension"
8183
if (-Not $simulate) {
8284
if ($vscodeTarget -eq "insiders") {
83-
vsce publish --pre-release --packagePath $extension --pat $vscodeToken --noVerify
85+
vsce publish --pre-release --packagePath $extension --manifestPath $manifest --signaturePath $signature --pat $vscodeToken --noVerify
8486
}
8587
else{
86-
vsce publish --packagePath $extension --pat $vscodeToken --noVerify
88+
vsce publish --packagePath $extension --manifestPath $manifest --signaturePath $signature --pat $vscodeToken --noVerify
8789
}
88-
90+
8991
}
9092
}
9193
}

eng/publish/publish-npm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ stages:
1818
variables:
1919
- group: AzureDevOps-Artifact-Feeds-Pats
2020
- name: NodeJSVersion
21-
value: '12.16.1'
21+
value: '22.18.0'
2222
steps:
2323
- task: NodeTool@0
2424
displayName: Add NodeJS/npm

0 commit comments

Comments
 (0)